Skip to content

Commit

Permalink
Windows: fix jasmine_node_test on Windows with TW
Browse files Browse the repository at this point in the history
Fix the jasmine_node_test() rule on Windows when
tested with Bazel's Windows-native test wrapper
(see bazelbuild/bazel#5508).

jasmine_node_test now uses nodejs_test_macro, so
on Windows it depends on the sh_test (whose output
is an .exe file) and not on nodejs_test (whose
output is a .sh file). The native test wrapper
can't test nodejs_test directly because it can't
create a subprocess for an .sh file.
  • Loading branch information
laszlocsomor committed Apr 16, 2019
1 parent 593d47d commit c2212de
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/jasmine_node_test/jasmine_node_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ than launching a test in Karma, for example.
"""

load("//internal/common:devmode_js_sources.bzl", "devmode_js_sources")
load("//internal/node:node.bzl", "nodejs_test")
load("//internal/node:node.bzl", "nodejs_test_macro")

def jasmine_node_test(
name,
Expand Down Expand Up @@ -59,15 +59,13 @@ def jasmine_node_test(
all_data = data + srcs + deps
all_data += [Label("//internal/jasmine_node_test:jasmine_runner.js")]
all_data += [":%s_devmode_srcs.MF" % name]
all_data += [Label("@bazel_tools//tools/bash/runfiles")]
entry_point = "build_bazel_rules_nodejs/internal/jasmine_node_test/jasmine_runner.js"

nodejs_test(
nodejs_test_macro(
name = name,
data = all_data,
entry_point = entry_point,
templated_args = ["$(location :%s_devmode_srcs.MF)" % name],
testonly = 1,
expected_exit_code = expected_exit_code,
tags = tags,
**kwargs
Expand Down

0 comments on commit c2212de

Please # to comment.