-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathcreate-execution-observer.unit.test.ts
More file actions
33 lines (28 loc) · 1.07 KB
/
create-execution-observer.unit.test.ts
File metadata and controls
33 lines (28 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { expect, vi } from 'vitest';
import { createExecutionObserver } from './create-execution-observer.js';
describe('createExecutionObserver', () => {
it('should create execution observer with default settings', () => {
expect(createExecutionObserver()).toStrictEqual({
onStderr: expect.any(Function),
onStdout: expect.any(Function),
});
});
it('should create execution observer with silent false settings', () => {
expect(createExecutionObserver({ silent: false })).toStrictEqual({
onStderr: expect.any(Function),
onStdout: expect.any(Function),
});
});
it('should create execution observer with default silent taking priority over CP_VERBOSE flag', () => {
vi.stubEnv('CP_VERBOSE', 'false');
expect(createExecutionObserver()).toStrictEqual({
onStderr: expect.any(Function),
onStdout: expect.any(Function),
});
});
it('should create execution observer with silent setting', () => {
expect(createExecutionObserver({ silent: true })).toStrictEqual({
onStderr: expect.any(Function),
});
});
});