Skip to content

Commit f020403

Browse files
authored
build: add flag for running tests with ViewEngine (#19056)
Proxies the `config` flag in the test command so that we're able to switch between Ivy and ViewEngine.
1 parent 7d47b45 commit f020403

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/run-component-tests.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ shelljs.set('-e');
4444
shelljs.cd(projectDir);
4545

4646
// Extracts the supported command line options.
47-
const {_: components, local, firefox, watch} = minimist(args, {
48-
boolean: ['local', 'firefox', 'watch'],
49-
default: {watch: true},
47+
const {_: components, local, firefox, watch, 'view-engine': viewEngine} = minimist(args, {
48+
boolean: ['local', 'firefox', 'watch', 'view-engine'],
49+
default: {watch: true, 'view-engine': false},
5050
});
5151

5252
// Whether tests for all components should be run.
@@ -64,13 +64,14 @@ if (local && (components.length > 1 || all)) {
6464
const bazelBinary = `yarn -s ${watch ? 'ibazel' : 'bazel'}`;
6565
const testTargetName =
6666
`unit_tests_${local ? 'local' : firefox ? 'firefox-local' : 'chromium-local'}`;
67+
const configFlag = viewEngine ? '--config=view-engine' : '';
6768

6869
// If `all` has been specified as component, we run tests for all components
6970
// in the repository. The `--firefox` flag can be still specified.
7071
if (all) {
7172
shelljs.exec(
7273
`${bazelBinary} test //src/... --test_tag_filters=-e2e,-browser:${testTargetName} ` +
73-
`--build_tag_filters=-browser:${testTargetName} --build_tests_only`);
74+
`--build_tag_filters=-browser:${testTargetName} --build_tests_only ${configFlag}`);
7475
return;
7576
}
7677

@@ -92,7 +93,7 @@ const testLabels = components
9293
.map(t => `${getBazelPackageOfComponentName(t)}:${testTargetName}`);
9394

9495
// Runs Bazel for the determined test labels.
95-
shelljs.exec(`${bazelBinary} ${bazelAction} ${testLabels.join(' ')}`);
96+
shelljs.exec(`${bazelBinary} ${bazelAction} ${testLabels.join(' ')} ${configFlag}`);
9697

9798
/**
9899
* Gets the Bazel package label for the specified component name. Throws if

0 commit comments

Comments
 (0)