-
Notifications
You must be signed in to change notification settings - Fork 12k
/
Copy pathstats-json_spec_large.ts
33 lines (28 loc) · 1.11 KB
/
stats-json_spec_large.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
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Architect } from '@angular-devkit/architect';
import { browserBuild, createArchitect, host } from '../utils';
describe('Browser Builder stats json', () => {
const target = { project: 'app', target: 'build' };
let architect: Architect;
beforeEach(async () => {
await host.initialize().toPromise();
architect = (await createArchitect(host.root())).architect;
});
afterEach(async () => host.restore().toPromise());
it('works', async () => {
const { files } = await browserBuild(architect, host, target, { statsJson: true });
expect('stats.json' in files).toBe(true);
});
it('works with profile flag', async () => {
const { files } = await browserBuild(architect, host, target, { statsJson: true });
expect('stats.json' in files).toBe(true);
const stats = JSON.parse(await files['stats.json']);
expect(stats.chunks[0].modules[0].profile.building).toBeDefined();
});
});