Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Wiles committed Mar 13, 2019
1 parent e9ec1f4 commit 5368cc4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
1 change: 0 additions & 1 deletion packages/jasmine/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package(default_visibility = ["//visibility:public"])

exports_files([
"src/jasmine_runner.js",
"src/jasmine_runner_host.js",
# Exported to be consumed for generating skydoc.
"src/jasmine_node_test.bzl",
])
Expand Down
17 changes: 2 additions & 15 deletions packages/jasmine/src/jasmine_node_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,10 @@ def jasmine_node_test(
tags = tags,
)

runner_name = name + "." + "runner"

nodejs_binary(
name = runner_name,
data = [jasmine],
entry_point = "npm_bazel_jasmine/src/jasmine_runner.js",
)

all_data = data + srcs + deps
all_data = data + srcs + deps + [jasmine]
# code coverage reporting dependancy
all_data += ["@npm//v8-coverage"]
all_data += [
# ":jasmine_node_test_bin_loader.js",
":" + runner_name,
Label("//:src/jasmine_runner.js"),
]
all_data += [Label("//:src/jasmine_runner.js")]
all_data += [":%s_devmode_srcs.MF" % name]
all_data += [Label("@bazel_tools//tools/bash/runfiles")]
entry_point = "npm_bazel_jasmine/src/jasmine_runner.js"
Expand All @@ -78,7 +66,6 @@ def jasmine_node_test(
templated_args = ["$(location :%s_devmode_srcs.MF)" % name],
testonly = 1,
expected_exit_code = expected_exit_code,
configuration_env_vars = ["NODE_V8_COVERAGE"],
tags = tags,
**kwargs
)
10 changes: 5 additions & 5 deletions packages/jasmine/src/jasmine_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if (TOTAL_SHARDS) {
Error.stackTraceLimit = Infinity;

const IS_TEST_FILE = /[^a-zA-Z0-9](spec|test)\.js$/i;
const IS_MODULE_MODULE = /\/node_modules\//
const IS_NODE_MODULE = /\/node_modules\//

function main(args) {
if (!args.length) {
Expand All @@ -74,10 +74,10 @@ function main(args) {

const jrunner = new JasmineRunner({jasmineCore: jasmineCore});
const allFiles = fs.readFileSync(manifest, UTF8)
.split('\n')
.filter(l => l.length > 0)
// Filter out files from node_modules that match test.js or spec.js
.filter(f => !IS_MODULE_MODULE.test(f))
.split('\n')
.filter(l => l.length > 0)
// Filter out files from node_modules that match test.js or spec.js
.filter(f => !IS_NODE_MODULE.test(f))

// the relative directory the coverage reporter uses to find the files
const cwd = process.cwd()
Expand Down

0 comments on commit 5368cc4

Please sign in to comment.