blob: 3799b50059e5e72ea5a066596fdbddb3e601054a [file]
load("//internal/common:copy_to_bin.bzl", "copy_to_bin")
load("//packages/jasmine:index.bzl", "jasmine_node_test")
load("//packages/typescript:index.bzl", "ts_library")
jasmine_node_test(
name = "underscore_spec_test",
srcs = ["foo_spec.js"],
)
# Verify that a bootstrap script does not break the test
jasmine_node_test(
name = "underscore_spec_bootstrap_test",
srcs = ["foo_spec.js"],
data = ["bootstrap.js"],
templated_args = ["--node_options=--require=$$(rlocation $(location :bootstrap.js))"],
)
jasmine_node_test(
name = "underscore_test_test",
srcs = ["foo_test.js"],
)
jasmine_node_test(
name = "dot_spec_test",
srcs = ["foo.spec.js"],
)
jasmine_node_test(
name = "dot_test_test",
srcs = ["foo.test.js"],
)
jasmine_node_test(
name = "sharding_test",
srcs = ["sharded_test.js"],
shard_count = 3,
)
copy_to_bin(
name = "generated_require_spec",
srcs = ["generated_require.spec.js"],
)
jasmine_node_test(
name = "generated_require_spec_test",
# Use the generated_require.spec.js from the output tree
srcs = [":generated_require_spec"],
data = ["test.json"],
)
copy_to_bin(
name = "generated_runfiles_spec",
srcs = ["generated_runfiles.spec.js"],
)
jasmine_node_test(
name = "generated_runfiles_spec_test",
# Use the generated_runfiles.spec.js from the output tree
srcs = [":generated_runfiles_spec"],
data = ["test.json"],
)
# Verify that a bootstrap script does not break a sharded test
jasmine_node_test(
name = "sharding_bootstrap_test",
srcs = ["sharded_test.js"],
data = ["bootstrap.js"],
shard_count = 3,
templated_args = ["--node_options=--require=$$(rlocation $(location :bootstrap.js))"],
)
jasmine_node_test(
name = "failing_sharding_test",
srcs = ["failing_sharded_test.js"],
expected_exit_code = 3,
shard_count = 2,
)
# Verify that a bootstrap script does not break a failing sharded test
jasmine_node_test(
name = "failing_sharding_bootstrap_test",
srcs = ["failing_sharded_test.js"],
data = ["bootstrap.js"],
expected_exit_code = 3,
shard_count = 2,
templated_args = ["--node_options=--require=$$(rlocation $(location :bootstrap.js))"],
)
# Verify that a bootstrap script does not break a failing sharded test
jasmine_node_test(
name = "failing_sharding_bootstrap_fail_test",
srcs = ["failing_sharded_test.js"],
data = ["bootstrap_fail.js"],
expected_exit_code = 33,
shard_count = 2,
templated_args = ["--node_options=--require=$$(rlocation $(location :bootstrap_fail.js))"],
)
jasmine_node_test(
name = "filtering_test",
srcs = ["filtering_test.js"],
# This test will fail because usage of `fit` and `fdescribe` cause Jasmine
# to return a 'incomplete' status
# TODO(alexeagle): find a way to assert that the right things were filtered
# maybe sniff the stdout for Ran 1 of 3 specs
# or change the exit code for Jasmine 'incomplete' status
expected_exit_code = 3,
)
ts_library(
name = "coverage_test_srcs",
srcs = ["coverage_source.ts"],
)
jasmine_node_test(
name = "coverage_test",
srcs = [
"coverage.spec.js",
":coverage_test_srcs",
],
)
jasmine_node_test(
name = "args_test",
srcs = [
"args_test.js",
"dynamic_import.js",
],
args = [
# the --node_options arg will be consumed by the node launcher
"--node_options=--experimental-modules",
# the remaining args should be passed to the spec
"arg1",
"arg2",
"arg3",
],
)
jasmine_node_test(
name = "templated_args_test",
srcs = [
"args_test.js",
"dynamic_import.js",
],
args = [
# args should be passed after templated_args
"arg3",
],
templated_args = [
# the --node_options templated arg will be consumed by the node launcher
"--node_options=--experimental-modules",
# the remaining args should be passed to the spec
"arg1",
"arg2",
],
)
# We have no srcs[] here because we set specs in the config file
jasmine_node_test(
name = "config_file_test",
config_file = "test_config_file.json",
# The file isn't named following our usual conventions
# but since it's configured in the json config file
# Jasmine will still load it
data = ["test_config_file.js"],
# TODO(alexeagle): on Windows CI we get no specs found
# Maybe Jasmine doesn't normalize the slashes in the config
tags = ["fix-windows"],
)
# Verify that the error code is propogated out from a failing spec
jasmine_node_test(
name = "fail_test",
srcs = ["fail.spec.js"],
expected_exit_code = 3,
)
# Verify that the error code is propogated out from a failing spec
# if there is a successful bootstrap script
jasmine_node_test(
name = "fail_bootstrap_test",
srcs = ["fail.spec.js"],
data = ["bootstrap.js"],
expected_exit_code = 3,
templated_args = ["--node_options=--require=$$(rlocation $(location :bootstrap.js))"],
)
# Verify that the error code is propogated out from a failing bootstrap script
jasmine_node_test(
name = "fail_bootstrap_fail_test",
srcs = ["fail.spec.js"],
data = ["bootstrap_fail.js"],
expected_exit_code = 33,
templated_args = ["--node_options=--require=$$(rlocation $(location :bootstrap_fail.js))"],
)
jasmine_node_test(
name = "stack_test",
srcs = ["stack.spec.js"],
)