/
infrastructure-logging.test.js
30 lines (23 loc) · 1.1 KB
/
infrastructure-logging.test.js
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
'use strict';
const { run } = require('../utils/test-utils');
describe('infrastructure logging related flag', () => {
it('should set infrastructureLogging.debug properly', () => {
const { exitCode, stderr, stdout } = run(__dirname, ['--infrastructure-logging-debug', 'myPlugin']);
expect(exitCode).toBe(0);
expect(stderr).toBeFalsy();
expect(stdout).toContain(`debug: [ 'myPlugin' ]`);
});
it('should reset infrastructureLogging.debug to []', () => {
const { exitCode, stderr, stdout } = run(__dirname, ['--infrastructure-logging-debug-reset']);
expect(exitCode).toBe(0);
expect(stderr).toBeFalsy();
expect(stdout).toContain(`debug: []`);
});
it('should set infrastructureLogging.level properly', () => {
const { exitCode, stderr, stdout } = run(__dirname, ['--infrastructure-logging-level', 'log']);
expect(exitCode).toBe(0);
expect(stderr).toContain("Compiler 'compiler' starting...");
expect(stderr).toContain("Compiler 'compiler' finished");
expect(stdout).toContain(`level: 'log'`);
});
});