@@ -159,6 +159,16 @@ def karma_web_test_suite(name, **kwargs):
159
159
kwargs ["srcs" ] = ["@npm//:node_modules/tslib/tslib.js" ] + getAngularUmdTargets () + kwargs .get ("srcs" , [])
160
160
kwargs ["deps" ] = ["//tools/rxjs:rxjs_umd_modules" ] + kwargs .get ("deps" , [])
161
161
162
+ # Set up default browsers if no explicit `browsers` have been specified.
163
+ if not hasattr (kwargs , "browsers" ):
164
+ kwargs ["tags" ] = ["native" ] + kwargs .get ("tags" , [])
165
+ kwargs ["browsers" ] = [
166
+ # Note: when changing the browser names here, also update the "yarn test"
167
+ # script to reflect the new browser names.
168
+ "@npm_angular_dev_infra_private//browsers:chromium" ,
169
+ "@io_bazel_rules_webtesting//browsers:firefox-local" ,
170
+ ]
171
+
162
172
for opt_name in kwargs .keys ():
163
173
# Filter out options which are specific to "karma_web_test" targets. We cannot
164
174
# pass options like "browsers" to the local web test target.
@@ -194,10 +204,11 @@ def karma_web_test_suite(name, **kwargs):
194
204
def protractor_web_test_suite (flaky = True , ** kwargs ):
195
205
_protractor_web_test_suite (
196
206
flaky = flaky ,
207
+ browsers = ["@npm_angular_dev_infra_private//browsers:chromium" ],
197
208
** kwargs
198
209
)
199
210
200
- def ng_web_test_suite (deps = [], static_css = [], bootstrap = [], tags = [], ** kwargs ):
211
+ def ng_web_test_suite (deps = [], static_css = [], bootstrap = [], ** kwargs ):
201
212
# Always include a prebuilt theme in the test suite because otherwise tests, which depend on CSS
202
213
# that is needed for measuring, will unexpectedly fail. Also always adding a prebuilt theme
203
214
# reduces the amount of setup that is needed to create a test suite Bazel target. Note that the
@@ -241,12 +252,6 @@ def ng_web_test_suite(deps = [], static_css = [], bootstrap = [], tags = [], **k
241
252
deps = [
242
253
"//test:angular_test_init" ,
243
254
] + deps ,
244
- browsers = [
245
- # Note: when changing the browser names here, also update the "yarn test"
246
- # script to reflect the new browser names.
247
- "@io_bazel_rules_webtesting//browsers:chromium-local" ,
248
- "@io_bazel_rules_webtesting//browsers:firefox-local" ,
249
- ],
250
255
bootstrap = [
251
256
# This matches the ZoneJS bundles used in default CLI projects. See:
252
257
# https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/application/files/src/polyfills.ts.template#L58
@@ -260,6 +265,5 @@ def ng_web_test_suite(deps = [], static_css = [], bootstrap = [], tags = [], **k
260
265
"@npm//:node_modules/zone.js/dist/zone-testing.js" ,
261
266
"@npm//:node_modules/reflect-metadata/Reflect.js" ,
262
267
] + bootstrap ,
263
- tags = ["native" ] + tags ,
264
268
** kwargs
265
269
)
0 commit comments