@@ -19,46 +19,38 @@ Error.stackTraceLimit = Infinity;
1919
2020/**
2121 * Here's a short description of those flags:
22- * --debug If a test fails, block the thread so the temporary directory isn't deleted.
23- * --noproject Skip creating a project or using one.
24- * --noglobal Skip linking your local @angular/cli directory. Can save a few seconds.
25- * --nosilent Never silence ng commands.
26- * --ng-tag=TAG Use a specific tag for build snapshots. Similar to ng-snapshots but point to a
27- * tag instead of using the latest `main`.
28- * --ng-snapshots Install angular snapshot builds in the test project.
29- * --glob Run tests matching this glob pattern (relative to tests/e2e/).
30- * --ignore Ignore tests matching this glob pattern.
31- * --reuse=/path Use a path instead of create a new project. That project should have been
32- * created, and npm installed. Ideally you want a project created by a previous
33- * run of e2e.
34- * --nb-shards Total number of shards that this is part of. Default is 2 if --shard is
35- * passed in.
36- * --shard Index of this processes' shard.
37- * --tmpdir=path Override temporary directory to use for new projects.
38- * --yarn Use yarn as package manager .
39- * --package=path An npm package to be published before running tests
22+ * --debug If a test fails, block the thread so the temporary directory isn't deleted.
23+ * --noproject Skip creating a project or using one.
24+ * --noglobal Skip linking your local @angular/cli directory. Can save a few seconds.
25+ * --nosilent Never silence ng commands.
26+ * --ng-tag=TAG Use a specific tag for build snapshots. Similar to ng-snapshots but point to a
27+ * tag instead of using the latest `main`.
28+ * --ng-snapshots Install angular snapshot builds in the test project.
29+ * --glob Run tests matching this glob pattern (relative to tests/e2e/).
30+ * --ignore Ignore tests matching this glob pattern.
31+ * --reuse=/path Use a path instead of create a new project. That project should have been
32+ * created, and npm installed. Ideally you want a project created by a previous
33+ * run of e2e.
34+ * --nb-shards Total number of shards that this is part of. Default is 2 if --shard is
35+ * passed in.
36+ * --shard Index of this processes' shard.
37+ * --tmpdir=path Override temporary directory to use for new projects.
38+ * --package-manager Package manager to use .
39+ * --package=path An npm package to be published before running tests
4040 *
4141 * If unnamed flags are passed in, the list of tests will be filtered to include only those passed.
4242 */
4343const argv = yargsParser ( process . argv . slice ( 2 ) , {
44- boolean : [
45- 'debug' ,
46- 'esbuild' ,
47- 'ng-snapshots' ,
48- 'noglobal' ,
49- 'nosilent' ,
50- 'noproject' ,
51- 'verbose' ,
52- 'yarn' ,
53- ] ,
54- string : [ 'devkit' , 'glob' , 'reuse' , 'ng-tag' , 'tmpdir' , 'ng-version' ] ,
44+ boolean : [ 'debug' , 'esbuild' , 'ng-snapshots' , 'noglobal' , 'nosilent' , 'noproject' , 'verbose' ] ,
45+ string : [ 'devkit' , 'glob' , 'reuse' , 'ng-tag' , 'tmpdir' , 'ng-version' , 'package-manager' ] ,
5546 number : [ 'nb-shards' , 'shard' ] ,
5647 array : [ 'package' , 'ignore' ] ,
5748 configuration : {
5849 'camel-case-expansion' : false ,
5950 'dot-notation' : false ,
6051 } ,
6152 default : {
53+ 'package-manager' : 'npm' ,
6254 'package' : [ './dist/_*.tgz' ] ,
6355 'debug' : ! ! process . env . BUILD_WORKSPACE_DIRECTORY ,
6456 'glob' : process . env . TESTBRIDGE_TEST_ONLY ,
@@ -140,8 +132,8 @@ const allTests = glob
140132 // will be executed on the same shard.
141133 const fileName = path . basename ( name ) ;
142134 if (
143- ( fileName . startsWith ( 'yarn-' ) && ! argv . yarn ) ||
144- ( fileName . startsWith ( 'npm-' ) && argv . yarn )
135+ ( fileName . startsWith ( 'yarn-' ) && argv [ 'package-manager' ] !== ' yarn' ) ||
136+ ( fileName . startsWith ( 'npm-' ) && argv [ 'package-manager' ] !== 'npm' )
145137 ) {
146138 return false ;
147139 }
@@ -197,7 +189,7 @@ if (testsToRun.length == allTests.length) {
197189console . log ( [ 'Tests:' , ...testsToRun ] . join ( '\n ' ) ) ;
198190
199191setGlobalVariable ( 'argv' , argv ) ;
200- setGlobalVariable ( 'package-manager' , argv . yarn ? 'yarn' : 'npm' ) ;
192+ setGlobalVariable ( 'package-manager' , argv [ 'package-manager' ] ) ;
201193
202194// Use the chrome supplied by bazel or the puppeteer chrome and webdriver-manager driver outside.
203195// This is needed by karma-chrome-launcher, protractor etc.
0 commit comments