Skip to content

Commit

Permalink
port #398 to new jasmine_node_test
Browse files Browse the repository at this point in the history
add a test case for it
  • Loading branch information
alexeagle committed Jun 4, 2019
1 parent 01a49a4 commit c3f9335
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/jasmine/src/jasmine_node_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def jasmine_node_test(
all_data += [Label("@bazel_tools//tools/bash/runfiles")]
entry_point = "@bazel/jasmine/src/jasmine_runner.js"

templated_args = ["$(location :%s_devmode_srcs.MF)" % name]
# If the target specified templated_args, pass it through.
templated_args = kwargs.pop("templated_args", []) + ["$(location :%s_devmode_srcs.MF)" % name]

if coverage:
templated_args = templated_args + ["--coverage"]
else:
Expand Down
10 changes: 10 additions & 0 deletions packages/jasmine/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,13 @@ jasmine_node_test(
"@npm//v8-coverage",
],
)

jasmine_node_test(
name = "templated_args_test",
srcs = ["templated_args_test.js"],
jasmine = "@npm//jasmine",
deps = ["//:jasmine_runner"],
templated_args = [
"--node_options=--experimental-modules",
],
)
7 changes: 7 additions & 0 deletions packages/jasmine/test/templated_args_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
describe('args', () => {
it('should pass through templated_args', () => {
// without --node_options=--experimental-modules this will fail
import('../index');
});
});

0 comments on commit c3f9335

Please sign in to comment.