Skip to content

Commit b0fd35e

Browse files
filipesilvahansl
authored andcommitted
feat(@angular/cli): add --preserve-symlinks to ng test
Fix #7081
1 parent dea04b1 commit b0fd35e

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

packages/@angular/cli/commands/test.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { oneLine } from 'common-tags';
55

66
const config = CliConfig.fromProject() || CliConfig.fromGlobal();
77
const testConfigDefaults = config.getPaths('defaults.build', [
8-
'progress', 'poll'
8+
'progress', 'poll', 'preserveSymlinks'
99
]);
1010

1111
export interface TestOptions {
@@ -23,6 +23,7 @@ export interface TestOptions {
2323
poll?: number;
2424
environment?: string;
2525
app?: string;
26+
preserveSymlinks?: boolean;
2627
}
2728

2829

@@ -109,6 +110,12 @@ const TestCommand = Command.extend({
109110
aliases: ['e'] ,
110111
description: 'Defines the build environment.'
111112
},
113+
{
114+
name: 'preserve-symlinks',
115+
type: Boolean,
116+
description: 'Do not use the real path when resolving modules.',
117+
default: testConfigDefaults['preserveSymlinks']
118+
},
112119
{
113120
name: 'app',
114121
type: String,

packages/@angular/cli/plugins/karma.ts

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const init: any = (config: any, emitter: any, customFileHandlers: any) => {
5454
codeCoverage: false,
5555
sourcemaps: true,
5656
progress: true,
57+
preserveSymlinks: false,
5758
}, config.angularCli);
5859

5960
if (testConfig.sourcemaps) {

packages/@angular/cli/tasks/test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export default Task.extend({
4040
progress: options.progress,
4141
poll: options.poll,
4242
environment: options.environment,
43+
preserveSymlinks: options.preserveSymlinks,
4344
app: options.app
4445
};
4546

0 commit comments

Comments
 (0)