From c54cce4dbabe8621622b57e0744786b797f35ac0 Mon Sep 17 00:00:00 2001 From: Tobias Rho Date: Tue, 12 Sep 2017 14:38:17 +0200 Subject: [PATCH 1/2] add option to preserve symlinks for module resolution in test task MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds support for —preserveSymlinks parameter in ng test task/command equivalent to the build command parameter added in https://github.com/angular/angular-cli/pull/6460 --- packages/@angular/cli/commands/test.ts | 7 +++++++ packages/@angular/cli/tasks/test.ts | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/@angular/cli/commands/test.ts b/packages/@angular/cli/commands/test.ts index aced9a85168c..64ac5b399f16 100644 --- a/packages/@angular/cli/commands/test.ts +++ b/packages/@angular/cli/commands/test.ts @@ -23,6 +23,7 @@ export interface TestOptions { poll?: number; environment?: string; app?: string; + preserveSymlinks?:boolean; } @@ -114,6 +115,12 @@ const TestCommand = Command.extend({ type: String, aliases: ['a'], description: 'Specifies app name to use.' + }, + { + name: 'preserve-symlinks', + type: Boolean, + description: 'Do not use the real path when resolving modules.', + default: false } ], diff --git a/packages/@angular/cli/tasks/test.ts b/packages/@angular/cli/tasks/test.ts index a41ec55ac4f5..2b9c3234b639 100644 --- a/packages/@angular/cli/tasks/test.ts +++ b/packages/@angular/cli/tasks/test.ts @@ -40,7 +40,8 @@ export default Task.extend({ progress: options.progress, poll: options.poll, environment: options.environment, - app: options.app + app: options.app, + preserveSymlinks: options.preserveSymlinks }; // Assign additional karmaConfig options to the local ngapp config From 956d545ce76e2add3fc19acbd5f6d24d5260da25 Mon Sep 17 00:00:00 2001 From: Tobias Rho Date: Tue, 12 Sep 2017 15:11:19 +0200 Subject: [PATCH 2/2] Fixed lint error --- package-lock.json | 40 +++++++++++++------------- packages/@angular/cli/commands/test.ts | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index a7ce48cd5c33..b84ae3fb85c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@angular/cli", - "version": "1.4.0", + "version": "1.4.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -258,6 +258,16 @@ "@types/uglify-js": "2.6.29" } }, + "JSONStream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", + "dev": true, + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + }, "abbrev": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", @@ -1603,8 +1613,8 @@ "integrity": "sha1-4ye1MZThp61dxjR57pCZpSsCSGU=", "dev": true, "requires": { - "is-text-path": "1.0.1", "JSONStream": "1.3.1", + "is-text-path": "1.0.1", "lodash": "4.17.4", "meow": "3.7.0", "split2": "2.1.1", @@ -4226,16 +4236,6 @@ "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", "dev": true }, - "JSONStream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", - "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", - "dev": true, - "requires": { - "jsonparse": "1.3.1", - "through": "2.3.8" - } - }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -6993,14 +6993,6 @@ "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "requires": { - "safe-buffer": "5.1.1" - } - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -7036,6 +7028,14 @@ "function-bind": "1.1.0" } }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", diff --git a/packages/@angular/cli/commands/test.ts b/packages/@angular/cli/commands/test.ts index 64ac5b399f16..d3657c8af6dc 100644 --- a/packages/@angular/cli/commands/test.ts +++ b/packages/@angular/cli/commands/test.ts @@ -23,7 +23,7 @@ export interface TestOptions { poll?: number; environment?: string; app?: string; - preserveSymlinks?:boolean; + preserveSymlinks?: boolean; }