aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/unittests.js
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-08-27 10:32:28 +0000
committerMaximilian Krambach <[email protected]>2018-08-27 10:38:32 +0000
commit766d42c248a8c526b831685e93d54db81492f5a8 (patch)
tree3d4b0794e4b59f1a347548b0277662d3005b7365 /lang/js/unittests.js
parentjson: Do not put FILE_NAME into the verify result. (diff)
downloadgpgme-766d42c248a8c526b831685e93d54db81492f5a8.tar.gz
gpgme-766d42c248a8c526b831685e93d54db81492f5a8.zip
js: typecheck destructured parameters
-- * destructuring just takes the input argument and treats it as object. In cases like in src/Keyring/generateKey, where I forgot to change the old syntax, the fingerprint as string was destructured into an object without "pattern", which caused all Keys to be retrieved. So, methods with a destructuring now check if the first argument is an object and get a default empty object if no parameter is submitted. This allows the further use of destructured parameters, while still ensuring nothing vastly incorrect is used. * src/Kering.js, unittsets.js: fixed old syntax in method usage
Diffstat (limited to 'lang/js/unittests.js')
-rw-r--r--lang/js/unittests.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/lang/js/unittests.js b/lang/js/unittests.js
index 8f1ffb66..de06320e 100644
--- a/lang/js/unittests.js
+++ b/lang/js/unittests.js
@@ -287,13 +287,14 @@ function unittests (){
it('Querying non-existing Key from Keyring', function (done){
let keyring = new GPGME_Keyring;
- keyring.getKeys(kp.invalidKeyFingerprint, true).then(
- function (result){
- expect(result).to.be.an('array');
- expect(result.length).to.equal(0);
- done();
- }
- );
+ keyring.getKeys({
+ pattern: kp.invalidKeyFingerprint,
+ prepare_sync: true
+ }).then(function (result){
+ expect(result).to.be.an('array');
+ expect(result.length).to.equal(0);
+ done();
+ });
});
});