We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7975065 commit 5ffcabcCopy full SHA for 5ffcabc
tests/utils.test.js
@@ -5,12 +5,19 @@ import {
5
describe,
6
} from 'vitest';
7
8
-import { graceful } from '../lib/utils';
+import { graceful } from '../lib/utils.js';
9
+import { EMPTY_STRING_INPUT } from './seeds.js';
10
11
describe('Graceful', () => {
12
test('Execute graceful', () => {
13
const fn = vi.fn();
14
graceful(fn);
15
expect(fn).toBeCalled();
16
});
17
+
18
+ test('Trigger graceful exit', () => {
19
+ const processExit = vi.spyOn(process, 'exit').mockImplementation(() => {});
20
+ graceful(EMPTY_STRING_INPUT);
21
+ expect(processExit).toHaveBeenCalled();
22
+ });
23
0 commit comments