Skip to content

Commit 6aa5d86

Browse files
committedDec 8, 2019
fix bug "expected 3 arguments"
1 parent f06d948 commit 6aa5d86

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed
 

‎package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@
5151
"build-components": "node-gyp configure build --directory=tests/components",
5252
"install": "node ./scripts/prepublish.js && npm run build",
5353
"lint": "eslint .",
54-
"test": "npm run lint && tape ./tests/unit/**/*.js | tap-spec",
54+
"test": "npm run lint && npm run test-unit",
5555
"test-components": "npm run build-components && tape ./tests/components/**/*.js | tap-spec",
56-
"test-integration": "node ./tests/integration/index"
56+
"test-integration": "node ./tests/integration/index",
57+
"test-unit": "tape ./tests/unit/**/*.js | tap-spec"
5758
},
5859
"engines": {
5960
"node": ">=8.9.4"

‎tests/unit/zookeeper/nativeobjecttest.js

+10
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,13 @@ test('native object emits close and pass an instance of the current ZooKeeper',
5757

5858
zk.native.emit('close', 1, 2, 3);
5959
});
60+
61+
test('native zookeeper add_auth', (t) => {
62+
t.plan(3);
63+
64+
const zk = new ZooKeeper({});
65+
66+
t.throws(() => zk.native.add_auth('digest'), 'expected 3 arguments');
67+
t.throws(() => zk.native.add_auth('digest', 'user:'), 'expected 3 arguments');
68+
t.doesNotThrow(() => zk.native.add_auth('digest', 'user:', () => {}), 'expected 3 arguments');
69+
});

0 commit comments

Comments
 (0)
Please sign in to comment.