Skip to content

Commit e5db7c9

Browse files
authored
Merge pull request #68 from mainmatter/pichfl/start
Make start the default command for auto-reveal
2 parents 76b8ac6 + 63eb342 commit e5db7c9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/program.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ program.description(process.env.npm_package_description);
1111
program.version(process.env.npm_package_version);
1212

1313
program
14-
.command('start')
14+
.command('start', {
15+
isDefault: true,
16+
})
1517
.description('Live-reloading server for your slides.')
1618
.option('-p, --port <port>', 'Port to run the server on', 1337)
1719
.action(start);

tests/program.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ describe('auto-reveal CLI', () => {
1616
vi.clearAllMocks();
1717
});
1818

19+
test('Using auto-reveal without any command triggers the start function', async () => {
20+
await program.parseAsync(['node', 'auto-reveal']);
21+
22+
expect(start).toBeCalledTimes(1);
23+
});
24+
1925
test('Using auto-reveal start triggers the start function', async () => {
2026
await program.parseAsync(['node', 'auto-reveal', 'start']);
2127

0 commit comments

Comments
 (0)