test: fix flaky profile flag test large

This change addresses the flaky profile flag test large that sometimes caused `RangeError Maximum call stack size exceeded` inside regex
This commit is contained in:
Alan Agius 2019-04-12 12:39:31 +02:00 committed by Alex Eagle
parent 92913e46b1
commit 8432650efd

View File

@ -27,7 +27,7 @@ describe('Browser Builder stats json', () => {
it('works with profile flag', async () => {
const { files } = await browserBuild(architect, host, target, { statsJson: true });
expect('stats.json' in files).toBe(true);
const stats = await files['stats.json'];
expect(stats).toMatch(/profile.+building/);
const stats = JSON.parse(await files['stats.json']);
expect(stats.chunks[0].modules[0].profile.building).toBeDefined();
});
});