Alan Agius 15677d0cb7 refactor: replace critters with beasties
The Critters project has been transferred to the Nuxt team, who will now manage its development and has been renamed to Beasties.

See: https://github.com/danielroe/beasties
2024-10-28 18:57:05 +01:00

59 lines
1.6 KiB
Python

load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:defaults.bzl", "ts_library")
ts_library(
name = "unit_test_lib",
testonly = True,
srcs = glob(["**/*.ts"]),
deps = [
"@npm//@bazel/runfiles",
],
)
jasmine_node_test(
name = "test",
srcs = [":unit_test_lib"],
data = [
"//packages/angular/ssr:npm_package",
],
)
genrule(
name = "beasties_license_file",
srcs = [
"//packages/angular/ssr:npm_package",
],
outs = [
"THIRD_PARTY_LICENSES.txt",
],
cmd = """
cp $(location //packages/angular/ssr:npm_package)/third_party/beasties/THIRD_PARTY_LICENSES.txt $(location :THIRD_PARTY_LICENSES.txt)
""",
)
diff_test(
name = "beasties_license_test",
failure_message = """
To accept the new golden file, execute:
yarn bazel run //packages/angular/ssr/test/npm_package:beasties_license_test.accept
""",
file1 = ":THIRD_PARTY_LICENSES.txt.golden",
file2 = ":beasties_license_file",
)
write_file(
name = "beasties_license_test.accept",
out = "beasties_license_file_accept.sh",
content =
[
"#!/usr/bin/env bash",
"cd ${BUILD_WORKSPACE_DIRECTORY}",
"yarn bazel build //packages/angular/ssr:npm_package",
"cp -fv dist/bin/packages/angular/ssr/npm_package/third_party/beasties/THIRD_PARTY_LICENSES.txt packages/angular/ssr/test/npm_package/THIRD_PARTY_LICENSES.txt.golden",
],
is_executable = True,
)