Skip to content

Commit e1596c8

Browse files
author
Alex Eagle
committed
concatjs_web back to karma_web
1 parent af59591 commit e1596c8

File tree

18 files changed

+63
-63
lines changed

18 files changed

+63
-63
lines changed

examples/angular/WORKSPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies")
5959

6060
npm_bazel_protractor_dependencies()
6161

62-
# Load concatjs_web_test dependencies
62+
# Load karma_web_test dependencies
6363
http_archive(
6464
name = "io_bazel_rules_webtesting",
6565
sha256 = "9bb461d5ef08e850025480bab185fd269242d4e533bca75bfb748001ceb343c3",

examples/angular/src/app/hello-world/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@io_bazel_rules_sass//:defs.bzl", "multi_sass_binary")
2-
load("@npm//@bazel/concatjs:index.bzl", "concatjs_web_test_suite")
2+
load("@npm//@bazel/concatjs:index.bzl", "karma_web_test_suite")
33
load("@npm//@bazel/typescript:index.bzl", "ts_library")
44
load("//tools:angular_ts_library.bzl", "ng_ts_library")
55

@@ -49,7 +49,7 @@ ts_library(
4949
],
5050
)
5151

52-
concatjs_web_test_suite(
52+
karma_web_test_suite(
5353
name = "test",
5454
srcs = [
5555
# We are manaully adding the bazel generated named-UMD date-fns bundle here as

examples/angular_view_engine/src/app/hello-world/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
2-
load("@npm//@bazel/concatjs:index.bzl", "concatjs_web_test_suite")
2+
load("@npm//@bazel/concatjs:index.bzl", "karma_web_test_suite")
33
load("@npm//@bazel/typescript:index.bzl", "ts_library")
44
load("@npm_angular_bazel//:index.bzl", "ng_module")
55

@@ -59,7 +59,7 @@ ts_library(
5959
],
6060
)
6161

62-
concatjs_web_test_suite(
62+
karma_web_test_suite(
6363
name = "test",
6464
srcs = [
6565
# We are manaully adding the bazel generated named-UMD date-fns bundle here as

examples/protocol_buffers/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@npm//@bazel/concatjs:index.bzl", "concatjs_devserver", "concatjs_web_test_suite")
1+
load("@npm//@bazel/concatjs:index.bzl", "concatjs_devserver", "karma_web_test_suite")
22
load("@npm//@bazel/labs:index.bzl", "ts_proto_library")
33
load("@npm//@bazel/protractor:index.bzl", "protractor_web_test_suite")
44
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
@@ -53,7 +53,7 @@ ts_library(
5353
],
5454
)
5555

56-
concatjs_web_test_suite(
56+
karma_web_test_suite(
5757
name = "test",
5858
srcs = [
5959
"@npm//@bazel/labs/grpc_web:bootstrap_scripts",

examples/web_testing/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@npm//@bazel/concatjs:index.bzl", "concatjs_web_test_suite")
1+
load("@npm//@bazel/concatjs:index.bzl", "karma_web_test_suite")
22
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_library")
33

44
ts_library(
@@ -35,7 +35,7 @@ ts_library(
3535
],
3636
)
3737

38-
concatjs_web_test_suite(
38+
karma_web_test_suite(
3939
name = "config_test",
4040
browsers = [
4141
"@io_bazel_rules_webtesting//browsers:chromium-local",
@@ -55,7 +55,7 @@ concatjs_web_test_suite(
5555
],
5656
)
5757

58-
concatjs_web_test_suite(
58+
karma_web_test_suite(
5959
name = "no_config_test",
6060
browsers = [
6161
"@io_bazel_rules_webtesting//browsers:chromium-local",

packages/concatjs/_README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Most packages do not ship with this format, so in order to use concatjs tooling,
1919
This is at the core of how Google does JavaScript development.
2020
So Bazel rules that originated in Google's codebase have affordances for concatjs.
2121
For example `ts_library` produces named AMD modules in its "devmode" output, and
22-
`concatjs_web_test` expects to bundle inputs using concatjs.
22+
`karma_web_test` expects to bundle inputs using concatjs.
2323

2424
## Serving JS in development mode under Bazel
2525

@@ -78,13 +78,13 @@ finishes.
7878

7979
## Testing with Karma
8080

81-
The `concatjs_web_test` rule runs karma tests with Bazel.
81+
The `karma_web_test` rule runs karma tests with Bazel.
8282

8383
It depends on rules_webtesting, so you need to add this to your `WORKSPACE`
8484
if you use the web testing rules in `@bazel/concatjs`:
8585

8686
```python
87-
# Fetch transitive Bazel dependencies of concatjs_web_test
87+
# Fetch transitive Bazel dependencies of karma_web_test
8888
http_archive(
8989
name = "io_bazel_rules_webtesting",
9090
sha256 = "9bb461d5ef08e850025480bab185fd269242d4e533bca75bfb748001ceb343c3",
@@ -109,7 +109,7 @@ browser_repositories(
109109
If you didn't use the `yarn_install` or `npm_install` rule to create an `npm` workspace, you'll have to declare a rule in your root `BUILD.bazel` file to execute karma:
110110

111111
```python
112-
# Create a karma rule to use in concatjs_web_test_suite karma
112+
# Create a karma rule to use in karma_web_test_suite karma
113113
# attribute when using self-managed dependencies
114114
nodejs_binary(
115115
name = "karma/karma",

packages/concatjs/index.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Users should not load files under "/internal"
1919

2020
load("//packages/concatjs/devserver:concatjs_devserver.bzl", _concatjs_devserver = "concatjs_devserver_macro")
2121
load(
22-
"//packages/concatjs/web_test:concatjs_web_test.bzl",
23-
_concatjs_web_test = "concatjs_web_test",
24-
_concatjs_web_test_suite = "concatjs_web_test_suite",
22+
"//packages/concatjs/web_test:karma_web_test.bzl",
23+
_karma_web_test = "karma_web_test",
24+
_karma_web_test_suite = "karma_web_test_suite",
2525
)
2626

27-
concatjs_web_test = _concatjs_web_test
28-
concatjs_web_test_suite = _concatjs_web_test_suite
27+
karma_web_test = _karma_web_test
28+
karma_web_test_suite = _karma_web_test_suite
2929
concatjs_devserver = _concatjs_devserver

packages/concatjs/web_test/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ filegroup(
5050
name = "package_contents",
5151
srcs = [
5252
"BUILD.bazel",
53-
"concatjs_web_test.bzl",
5453
"karma.conf.js",
54+
"karma_web_test.bzl",
5555
],
5656
)

packages/concatjs/web_test/concatjs_web_test.bzl

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ KARMA_PEER_DEPS = [
3131
"@npm//requirejs",
3232
]
3333

34-
CONCATJS_WEB_TEST_ATTRS = {
34+
karma_web_TEST_ATTRS = {
3535
"bootstrap": attr.label_list(
3636
doc = """JavaScript files to include *before* the module loader (require.js).
3737
For example, you can include Reflect,js for TypeScript decorator metadata reflection,
@@ -207,7 +207,7 @@ def _write_karma_config(ctx, files, amd_names_shim):
207207

208208
return configuration
209209

210-
def _concatjs_web_test_impl(ctx):
210+
def _karma_web_test_impl(ctx):
211211
files_depsets = [depset(ctx.files.srcs)]
212212
for dep in ctx.attr.deps + ctx.attr.runtime_deps:
213213
if JSNamedModuleInfo in dep:
@@ -316,17 +316,17 @@ ${{COMMAND}}
316316
executable = ctx.outputs.executable,
317317
)]
318318

319-
_concatjs_web_test = rule(
320-
implementation = _concatjs_web_test_impl,
319+
_karma_web_test = rule(
320+
implementation = _karma_web_test_impl,
321321
test = True,
322322
executable = True,
323-
attrs = CONCATJS_WEB_TEST_ATTRS,
323+
attrs = karma_web_TEST_ATTRS,
324324
outputs = {
325325
"configuration": "%{name}.conf.js",
326326
},
327327
)
328328

329-
def concatjs_web_test(
329+
def karma_web_test(
330330
srcs = [],
331331
deps = [],
332332
data = [],
@@ -361,7 +361,7 @@ def concatjs_web_test(
361361
362362
By default we open a headless Chrome. To use a real Chrome browser window, you can pass
363363
`--define DISPLAY=true` to Bazel, along with `configuration_env_vars = ["DISPLAY"]` on
364-
`concatjs_web_test`.
364+
`karma_web_test`.
365365
366366
Args:
367367
srcs: A list of JavaScript test files
@@ -385,11 +385,11 @@ def concatjs_web_test(
385385
certain attributes of this configuration file. Attributes that are
386386
overridden will be outputted to the test log.
387387
tags: Standard Bazel tags, this macro adds tags for ibazel support
388-
peer_deps: list of peer npm deps required by concatjs_web_test
389-
**kwargs: Passed through to `concatjs_web_test`
388+
peer_deps: list of peer npm deps required by karma_web_test
389+
**kwargs: Passed through to `karma_web_test`
390390
"""
391391

392-
_concatjs_web_test(
392+
_karma_web_test(
393393
srcs = srcs,
394394
deps = deps + peer_deps,
395395
data = data,
@@ -405,16 +405,16 @@ def concatjs_web_test(
405405
**kwargs
406406
)
407407

408-
def concatjs_web_test_suite(
408+
def karma_web_test_suite(
409409
name,
410410
browsers = None,
411411
web_test_data = [],
412412
wrapped_test_tags = list(DEFAULT_WRAPPED_TEST_TAGS),
413413
**kwargs):
414-
"""Defines a test_suite of web_test targets that wrap a concatjs_web_test target.
414+
"""Defines a test_suite of web_test targets that wrap a karma_web_test target.
415415
416-
This macro accepts all parameters in concatjs_web_test and adds additional parameters
417-
for the suite. See concatjs_web_test docs for all concatjs_web_test.
416+
This macro accepts all parameters in karma_web_test and adds additional parameters
417+
for the suite. See karma_web_test docs for all karma_web_test.
418418
419419
The wrapping macro is `web_test_suite` which comes from rules_websting:
420420
https://github.com/bazelbuild/rules_webtesting/blob/master/web/web.bzl.
@@ -424,8 +424,8 @@ def concatjs_web_test_suite(
424424
browsers: A sequence of labels specifying the browsers to use.
425425
web_test_data: Data dependencies for the wrapper web_test targets.
426426
wrapped_test_tags: A list of test tag strings to use for the wrapped
427-
concatjs_web_test target.
428-
**kwargs: Arguments for the wrapped concatjs_web_test target.
427+
karma_web_test target.
428+
**kwargs: Arguments for the wrapped karma_web_test target.
429429
"""
430430

431431
# Common attributes
@@ -452,9 +452,9 @@ def concatjs_web_test_suite(
452452
if not "native" in tags:
453453
tags = tags + ["native"]
454454

455-
# The wrapped `concatjs_web_test` target
455+
# The wrapped `karma_web_test` target
456456
wrapped_test_name = name + "_wrapped_test"
457-
concatjs_web_test(
457+
karma_web_test(
458458
name = wrapped_test_name,
459459
args = args,
460460
flaky = flaky,

packages/concatjs/web_test/karma.conf.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ try {
137137
}
138138

139139
/**
140-
* Configuration settings for karma under Bazel common to concatjs_web_test
141-
* and concatjs_web_test_suite.
140+
* Configuration settings for karma under Bazel common to karma_web_test
141+
* and karma_web_test_suite.
142142
*/
143143
function configureBazelConfig(config, conf) {
144144
// list of karma plugins
@@ -279,15 +279,15 @@ try {
279279
}
280280

281281
/**
282-
* Configure karma under concatjs_web_test_suite.
282+
* Configure karma under karma_web_test_suite.
283283
* `browsers` and `customLaunchers` are setup by Bazel.
284284
*/
285285
function configureTsWebTestSuiteConfig(conf) {
286286
// WEB_TEST_METADATA is configured in rules_webtesting based on value
287287
// of the browsers attribute passed to karms_web_test_suite
288288
// We setup the karma configuration based on the values in this object
289289
if (!process.env['WEB_TEST_METADATA']) {
290-
// This is a concatjs_web_test rule since there is no WEB_TEST_METADATA
290+
// This is a karma_web_test rule since there is no WEB_TEST_METADATA
291291
return;
292292
}
293293

@@ -369,7 +369,7 @@ try {
369369

370370
function configureTsWebTestConfig(conf) {
371371
if (process.env['WEB_TEST_METADATA']) {
372-
// This is a concatjs_web_test_suite rule since there is a WEB_TEST_METADATA
372+
// This is a karma_web_test_suite rule since there is a WEB_TEST_METADATA
373373
return;
374374
}
375375

0 commit comments

Comments
 (0)