Skip to content

Commit 71561a7

Browse files
committed
correctly match main bundle
1 parent c884682 commit 71561a7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/e2e/tests/build/prod-build.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {join} from 'path';
2+
import {readdirSync} from 'fs';
23
import {expectFileToExist, expectFileToMatch} from '../../utils/fs';
34
import {ng} from '../../utils/process';
45
import {expectGitToBeClean} from '../../utils/git';
@@ -13,9 +14,10 @@ export default function() {
1314
.then(() => expectFileToMatch('dist/index.html', /main\.[0-9a-f]{20}\.bundle\.js/))
1415
.then(() => expectFileToMatch('dist/index.html', /styles\.[0-9a-f]{20}\.bundle\.css/))
1516
// Defaults to AoT
16-
.then(() => expectFileToMatch('dist/main.bundle.js',
17-
/bootstrapModuleFactory.*\/\* AppModuleNgFactory \*\//))
18-
17+
.then(() => {
18+
const main = readdirSync('./dist').find(name => !!name.match(/main.[a-z0-9]+\.bundle\.js/));
19+
expectFileToMatch(`dist/${main}`, /bootstrapModuleFactory.*\/\* AppModuleNgFactory \*\//);
20+
})
1921
// Check that the process didn't change local files.
2022
.then(() => expectGitToBeClean());
2123
}

0 commit comments

Comments
 (0)