Alan Agius 4b4cecf88f test: update tests to work with Jasmine version 4
These changes include fixes to tests, timeout and stop of architect to make tests work with Jasmine 4.

One noticeable change that when we didn't stop architect through `run.stop()` this causes Bazel to timeout now.

Example
```
-- Test timed out at 2022-03-24 12:07:07 UTC --
/private/var/tmp/_bazel_alanagius/5168427e57f204ca069c602aa7ed1931/sandbox/darwin-sandbox/398/execroot/angular_cli/bazel-out/darwin-fastbuild/bin/packages/angular_devkit/build_angular/build_angular_browser_test.sh.runfiles/angular_cli/packages/angular_devkit/build_angular/build_angular_browser_test.sh: line 424: 41835 Terminated: 15          "${node}" ${LAUNCHER_NODE_OPTIONS[@]+"${LAUNCHER_NODE_OPTIONS[@]}"} ${USER_NODE_OPTIONS[@]+"${USER_NODE_OPTIONS[@]}"} "${MAIN}" ${ARGS[@]+"${ARGS[@]}"} 0<&0
```
2022-03-24 14:41:26 +01:00

95 lines
2.3 KiB
Python

# 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
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:defaults.bzl", "pkg_npm", "ts_library")
licenses(["notice"]) # MIT
package(default_visibility = ["//visibility:public"])
ts_library(
name = "benchmark",
package_name = "@angular-devkit/benchmark",
srcs = glob(
include = ["src/**/*.ts"],
exclude = [
"src/**/*_spec.ts",
"src/**/*_benchmark.ts",
],
),
module_name = "@angular-devkit/benchmark",
module_root = "src/index.d.ts",
deps = [
"//packages/angular_devkit/core",
"//packages/angular_devkit/core/node",
"@npm//@types/node",
"@npm//@types/pidusage",
"@npm//@types/yargs-parser",
"@npm//ansi-colors",
"@npm//rxjs",
],
)
ts_library(
name = "benchmark_test_lib",
testonly = True,
srcs = glob(["src/**/*_spec.ts"]),
data = [
"src/test/exit-code-one.js",
"src/test/fibonacci.js",
"src/test/test-script.js",
"src/test/watch-test-cmd.js",
"src/test/watch-test-file.txt",
"src/test/watch-test-script.js",
],
# @external_begin
deps = [
":benchmark",
"//packages/angular_devkit/core",
"//packages/angular_devkit/core/node",
"@npm//rxjs",
],
# @external_end
)
jasmine_node_test(
name = "benchmark_test",
srcs = [":benchmark_test_lib"],
deps = [
"@npm//jasmine",
"@npm//pidtree",
"@npm//pidusage",
"@npm//source-map",
"@npm//tree-kill",
"@npm//yargs-parser",
],
)
genrule(
name = "license",
srcs = ["//:LICENSE"],
outs = ["LICENSE"],
cmd = "cp $(execpath //:LICENSE) $@",
)
pkg_npm(
name = "npm_package",
pkg_deps = [
"//packages/angular_devkit/core:package.json",
],
deps = [
"src/test/exit-code-one.js",
"src/test/fibonacci.js",
"src/test/test-script.js",
"src/test/watch-test-cmd.js",
"src/test/watch-test-file.txt",
"src/test/watch-test-script.js",
":README.md",
":benchmark",
":license",
],
)