-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
output-style.test.ts
38 lines (34 loc) · 1.06 KB
/
output-style.test.ts
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
34
35
36
37
38
import { newProject, runCLI, updateProjectConfig } from '@nrwl/e2e/utils';
describe('Output Style', () => {
beforeEach(() => newProject());
it('should stream output', async () => {
const myapp = 'abcdefghijklmon';
runCLI(`generate @nrwl/web:app ${myapp}`);
updateProjectConfig(myapp, (c) => {
c.targets['inner'] = {
executor: 'nx:run-commands',
options: {
command: 'echo inner',
},
};
c.targets['echo'] = {
executor: 'nx:run-commands',
options: {
commands: ['echo 1', 'echo 2', `nx inner ${myapp}`],
parallel: false,
},
};
return c;
});
const withPrefixes = runCLI(`echo ${myapp} --output-style=stream`).split(
'\n'
);
expect(withPrefixes).toContain(`[${myapp}] 1`);
expect(withPrefixes).toContain(`[${myapp}] 2`);
expect(withPrefixes).toContain(`[${myapp}] inner`);
const noPrefixes = runCLI(
`echo ${myapp} --output-style=stream-without-prefixes`
);
expect(noPrefixes).not.toContain(`[${myapp}]`);
});
});