Skip to content

Commit

Permalink
correctly match main bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva committed Jan 22, 2017
1 parent c884682 commit 71561a7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/e2e/tests/build/prod-build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {join} from 'path';
import {readdirSync} from 'fs';
import {expectFileToExist, expectFileToMatch} from '../../utils/fs';
import {ng} from '../../utils/process';
import {expectGitToBeClean} from '../../utils/git';
Expand All @@ -13,9 +14,10 @@ export default function() {
.then(() => expectFileToMatch('dist/index.html', /main\.[0-9a-f]{20}\.bundle\.js/))
.then(() => expectFileToMatch('dist/index.html', /styles\.[0-9a-f]{20}\.bundle\.css/))
// Defaults to AoT
.then(() => expectFileToMatch('dist/main.bundle.js',
/bootstrapModuleFactory.*\/\* AppModuleNgFactory \*\//))

.then(() => {
const main = readdirSync('./dist').find(name => !!name.match(/main.[a-z0-9]+\.bundle\.js/));
expectFileToMatch(`dist/${main}`, /bootstrapModuleFactory.*\/\* AppModuleNgFactory \*\//);
})
// Check that the process didn't change local files.
.then(() => expectGitToBeClean());
}

0 comments on commit 71561a7

Please sign in to comment.