Skip to content

Commit

Permalink
Add multiple feature test
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesLMilner committed Jan 28, 2019
1 parent d47fa06 commit 8276d1a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/unit/registerCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ registerSuite('registerCommands', {
})
};
groupMap = getGroupMap(groupDef);
registerCommands(yargsStub, groupMap);
consoleErrorStub = stub(console, 'error');
},

Expand All @@ -276,6 +275,16 @@ registerSuite('registerCommands', {
assert.deepEqual(run.firstCall.args[1], { bar: 'bar', foo: 'foo' });
assert.isTrue(setStub.calledOnce);
assert.deepEqual(setStub.firstCall.args[0], { foo: 'foo' });
},
'should write all feature arguments to dojorc when save is passed'() {
process.argv = ['-f'];
const { run } = groupMap.get('group1').get('command1');
registerCommands(yargsStub, groupMap);
yargsStub.command.secondCall.args[3]({ f: { feature1: 'foo', feature2: 'bar' }, save: true });
assert.isTrue(run.calledOnce);
assert.deepEqual(run.firstCall.args[1], { f: { feature1: 'foo', feature2: 'bar' } });
assert.isTrue(setStub.calledOnce);
assert.deepEqual(setStub.firstCall.args[0], { f: { feature1: 'foo', feature2: 'bar' } });
}
}
},
Expand Down

0 comments on commit 8276d1a

Please sign in to comment.