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:
parent
6bb6588ce0
commit
6174dffc2a
|
@ -1,4 +1,4 @@
|
||||||
load("//tools:defaults.bzl", "ts_library")
|
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
|
||||||
|
|
||||||
package(default_visibility = ["//visibility:public"])
|
package(default_visibility = ["//visibility:public"])
|
||||||
|
|
||||||
|
@ -38,3 +38,27 @@ ts_library(
|
||||||
"//packages:types",
|
"//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,
|
||||||
|
)
|
||||||
|
|
|
@ -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);
|
Loading…
Reference in New Issue