test: test for regression where jasmine_node_test passes silently (#34736)

Adds tests to verify that jasmine_node_test targets fail as expected.
This is to catch any future regressions to jasmine_node_test where tests pass silently without executing.
See https://github.com/bazelbuild/rules_nodejs/pull/1540 for an example of a potential regression.

PR Close #34736
This commit is contained in:
Greg Magolan 2020-01-10 16:00:49 -08:00 committed by Matias Niemelä
parent 6bb6588ce0
commit 6174dffc2a
2 changed files with 33 additions and 1 deletions

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
package(default_visibility = ["//visibility:public"])
@ -38,3 +38,27 @@ ts_library(
"//packages:types",
],
)
# A test to verify that jasmine_node_test targets fail as expected.
# This is to catch any future regressions to jasmine_node_test where
# tests pass silently without executing.
# See https://github.com/bazelbuild/rules_nodejs/pull/1540 for an example
# of a potential regression.
jasmine_node_test(
name = "fail_test",
srcs = ["fail.spec.js"],
expected_exit_code = 55,
)
# A test to verify that jasmine_node_test targets fail as expected
# when there is a bootstrap script set.
# This is to catch any future regressions to jasmine_node_test where
# tests pass silently without executing.
# See https://github.com/bazelbuild/rules_nodejs/pull/1540 for an example
# of a potential regression.
jasmine_node_test(
name = "fail_bootstrap_test",
srcs = ["fail.spec.js"],
bootstrap = ["//tools/testing:node_es5"],
expected_exit_code = 55,
)

View File

@ -0,0 +1,8 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
process.exit(55);