fix(bazel): protractor rule does not run spec files with underscore (#28022)

There are various e2e tests with the `_spec.ts` suffix in the Angular project. Currently the protractor Bazel rule does not pick up these files and just ignores them. Since underscore is commonly used, we should support this.

Needed for the conversion fo the `examples` to Bazel.

PR Close #28022
This commit is contained in:
Paul Gschwendtner 2019-01-09 19:44:48 +01:00 committed by Andrew Kushnir
parent 76ed13bffe
commit 65e72e958e
1 changed files with 2 additions and 1 deletions

View File

@ -88,7 +88,8 @@ if (onPreparePath) {
// ts_web_test_suite & rules_webtesting WEB_TEST_METADATA attributes
setConf(conf, 'framework', 'jasmine2', 'is set to jasmine2');
const specs = [TMPL_specs].map(s => require.resolve(s)).filter(s => /\b(spec|test)\.js$/.test(s));
const specs =
[TMPL_specs].map(s => require.resolve(s)).filter(s => /(\b|_)(spec|test)\.js$/.test(s));
setConf(conf, 'specs', specs, 'are determined by the srcs and deps attribute');