1
0
Fork 0
cautious-journey/test/config/TestArgs.ts

25 lines
610 B
TypeScript
Raw Normal View History

import { expect } from 'chai';
import { stub } from 'sinon';
import { Commands, createParser } from '../../src/config/args';
describe('args', () => {
it('should set command mode', () => {
const modeStub = stub();
const parser = createParser(modeStub);
for (const command of [
Commands.GRAPH,
Commands.ISSUES,
Commands.LABELS,
]) {
const args = parser.parse([command, '--config', 'foo.yml']);
expect(args).to.deep.include({
dryrun: true,
});
expect(modeStub).to.have.been.calledWith(command);
modeStub.resetHistory();
}
});
});