Skip to content

Commit 2773429

Browse files
author
Chris Brody
authored
fix async CLI func tests again (#160)
simply do `await func(...)` rather than waiting for a 1ms timer
1 parent 55bf403 commit 2773429

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

tests/with-mocks/cli/command/func/with-logging/with-bogus-platforms/bogus-name/cli-command-with-bogus-platforms-name.test.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ test(`create alice-bobbi module with logging, with platforms: 'bogus'`, async ()
3838

3939
const options = { platforms: 'bogus' };
4040

41-
func(args, null, options);
42-
43-
// Using a 1 ms timer to wait for the
44-
// CLI command function to finish.
45-
// FUTURE TBD this looks like a bad smell
46-
// that should be resolved someday.
47-
await new Promise((resolve) => setTimeout(resolve, 1));
41+
await func(args, null, options);
4842

4943
expect(mysnap).toMatchSnapshot();
5044
});

tests/with-mocks/cli/command/func/with-logging/with-bogus-platforms/empty-string/cli-command-with-empty-platforms-string.test.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ test(`create alice-bobbi module with logging, with platforms: ''`, async () => {
3838

3939
const options = { platforms: '' };
4040

41-
func(args, null, options);
42-
43-
// Using a 1 ms timer to wait for the
44-
// CLI command function to finish.
45-
// FUTURE TBD this looks like a bad smell
46-
// that should be resolved someday.
47-
await new Promise((resolve) => setTimeout(resolve, 1));
41+
await func(args, null, options);
4842

4943
expect(mysnap).toMatchSnapshot();
5044
});

0 commit comments

Comments
 (0)