2020-08-28 23:51:46 +00:00
|
|
|
import { expect } from 'chai';
|
|
|
|
|
2023-01-01 23:15:22 +00:00
|
|
|
import { Commands, parseArgs } from '../../src/config/args.js';
|
2021-07-30 04:42:54 +00:00
|
|
|
|
2020-08-28 23:51:46 +00:00
|
|
|
describe('args', () => {
|
2022-11-23 13:46:31 +00:00
|
|
|
it('should set command mode', async () => {
|
2020-08-28 23:51:46 +00:00
|
|
|
for (const command of [
|
|
|
|
Commands.GRAPH,
|
|
|
|
Commands.ISSUES,
|
|
|
|
Commands.LABELS,
|
|
|
|
]) {
|
2022-11-23 13:46:31 +00:00
|
|
|
const args = await parseArgs([command, '--config', 'foo.yml']);
|
2020-08-28 23:51:46 +00:00
|
|
|
expect(args).to.deep.include({
|
|
|
|
dryrun: true,
|
2021-07-30 04:42:54 +00:00
|
|
|
mode: command,
|
2020-08-28 23:51:46 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|