Commit ec8a9b77 by Tomas Dvorak

Merge pull request #116 from todvora/master

ParameterParsingTest fix
parents 974c7bf8 d2e1c5d6
...@@ -52,13 +52,14 @@ describe('Parameters parsing', () => { ...@@ -52,13 +52,14 @@ describe('Parameters parsing', () => {
assert.deepEqual(params.query, {name:'Harry'}); assert.deepEqual(params.query, {name:'Harry'});
}); });
it('should recognize unknown collection', async () => { it('should recognize unknown collection', async (done) => {
try { try {
await test.runAnalysis({collection:'--unknown--'}); await test.runAnalysis({collection:'--unknown--'});
throw new Error('Should fail and be handled in catch branch'); done(new Error('Should throw an exception!'));
} catch(err) { } catch(err) {
assert.ok(err.code > 0); assert.ok(err.code > 0);
assert.ok(err.stdout.indexOf('The collection specified (--unknown--) in the database specified (test) does not exist or is empty.') > -1); assert.ok(err.stdout.indexOf('The collection specified (--unknown--) in the database specified (test) does not exist or is empty.') > -1);
done();
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment