Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 6.8k
build: dont run karma if compilation failed#3668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -75,13 +75,16 @@ gulp.task('test', [':test:deps'], () => { | ||
| }); | ||
| // Refreshes Karma's file list and schedules a test run. | ||
| let runTests = () => { | ||
| server.refreshFiles().then(() => server._injector.get('executor').schedule()); | ||
| // Tests will only run if TypeScript compilation was successful. | ||
| let runTests = (err?: Error) => { | ||
| if (!err) { | ||
| server.refreshFiles().then(() => server._injector.get('executor').schedule()); | ||
| } | ||
| }; | ||
| // Boot up the test server and run the tests whenever a new browser connects. | ||
| server.start(); | ||
| server.on('browser_register', runTests); | ||
| server.on('browser_register', () => runTests()); | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the extra level of wrapping here? MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because this event comes from Karma and it calls the callback with the | ||
| // Watch for file changes, rebuild and run the tests. | ||
| gulp.watch(patternRoot + '.ts', () => runSequence(':build:components:ts:spec', runTests)); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expand comment to say something like "Only run tests if TypeScript compilation is successful" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Anything else?