Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/@angular/cli/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ export interface TestOptions {
build?: boolean;
sourcemap?: boolean;
progress?: boolean;
config: string;
}


const TestCommand = EmberTestCommand.extend({
availableOptions: [
{ name: 'watch', type: Boolean, default: true, aliases: ['w'] },
{ name: 'code-coverage', type: Boolean, default: false, aliases: ['cc'] },
{ name: 'config', type: String, aliases: ['c'] },
{ name: 'single-run', type: Boolean, default: false, aliases: ['sr'] },
{ name: 'progress', type: Boolean, default: true},
{ name: 'browsers', type: String },
Expand Down
3 changes: 2 additions & 1 deletion packages/@angular/cli/tasks/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export default Task.extend({
const projectRoot = this.project.root;
return new Promise((resolve) => {
const karma = requireProjectModule(projectRoot, 'karma');
const karmaConfig = path.join(projectRoot, this.project.ngConfig.config.test.karma.config);
const karmaConfig = path.join(projectRoot, options.config ||
this.project.ngConfig.config.test.karma.config);

let karmaOptions: any = Object.assign({}, options);

Expand Down
5 changes: 4 additions & 1 deletion tests/e2e/tests/test/test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { ng } from '../../utils/process';
import { moveFile } from '../../utils/fs';

export default function () {
// make sure both --watch=false and --single-run work
return ng('test', '--single-run')
.then(() => ng('test', '--watch=false'));
.then(() => ng('test', '--watch=false'))
.then(() => moveFile('./karma.conf.js', './karma.conf.bis.js'))
.then(() => ng('test', '--single-run', '--config', 'karma.conf.bis.js'));
}