js: First testing and improvements
authorMaximilian Krambach <maximilian.krambach@intevation.de>
Wed, 25 Apr 2018 17:45:39 +0000 (19:45 +0200)
committerMaximilian Krambach <maximilian.krambach@intevation.de>
Wed, 25 Apr 2018 17:45:39 +0000 (19:45 +0200)
commit3685913bf510a14b8cb324d980217d90489e6453
treeeb1acbdee90bf747f2dfbd4c9a61ed83d41c2b8f
parent1fb310cabe578625f96fce5d84ff6f0092c08d24
js: First testing and improvements

--

* Introduced Mocha/chai as testsuite. After development build
  'npm test' should run the unit tests. Functionality exclusive to
  Browsers/WebExtensions cannot be run this way, so some other testing
  is still needed.

  - package.json: Added required development packages
  - .babelrc indirect configuration for mocha. ES6 transpiling
    needs some babel configuration, but mocha has no setting for it.
  - test/mocha.opts Vonfiguration for mocha runs

* Fixed errors:
  - Helpers.js toKeyIdArray; isLongId is now exported
  - Key.js Key constructor failed
  - Message.js will not throw an Error during construction, a new
    message is now created with createMessage, which can return an
    Error or a GPGME_Message object

* Tests:
  - test/Helpers: exports from Helpers.js, GPGME_Error handling
  - test/Message: first init test with bad parameters
12 files changed:
lang/js/.babelrc [new file with mode: 0644]
lang/js/package.json
lang/js/src/Connection.js
lang/js/src/Errors.js
lang/js/src/Helpers.js
lang/js/src/Key.js
lang/js/src/Keyring.js
lang/js/src/Message.js
lang/js/src/gpgmejs.js
lang/js/test/Helpers.js [new file with mode: 0644]
lang/js/test/Message.js [new file with mode: 0644]
lang/js/test/mocha.opts [new file with mode: 0644]