-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
storybook-angular.test.ts
44 lines (39 loc) · 1.17 KB
/
storybook-angular.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
39
40
41
42
43
44
import {
checkFilesExist,
cleanupProject,
killPorts,
newProject,
runCLI,
runCommandUntil,
uniq,
} from '@nx/e2e/utils';
describe('Storybook executors for Angular', () => {
const angularStorybookLib = uniq('test-ui-ng-lib');
beforeAll(() => {
newProject();
runCLI(`g @nx/angular:library ${angularStorybookLib} --no-interactive`);
runCLI(
`generate @nx/angular:storybook-configuration ${angularStorybookLib} --generateStories --no-interactive`
);
});
afterAll(() => {
cleanupProject();
});
describe('serve and build storybook', () => {
afterAll(() => killPorts());
it('should serve an Angular based Storybook setup', async () => {
const p = await runCommandUntil(
`run ${angularStorybookLib}:storybook`,
(output) => {
return /Storybook.*started/gi.test(output);
}
);
p.kill();
}, 200_000);
// Increased timeout because 92% sealing asset processing TerserPlugin
it('shoud build an Angular based storybook', () => {
runCLI(`run ${angularStorybookLib}:build-storybook`);
checkFilesExist(`dist/storybook/${angularStorybookLib}/index.html`);
}, 600_000);
});
});