blob: bfd4dcf86edc9ab4604f5553c3f3fb578b6dbd64 [file]
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_test", "npm_package")
# Copy common bazelrc file to be included in this package
genrule(
name = "copy_bazelrc",
srcs = ["//:common.bazelrc"],
outs = ["common.bazelrc"],
cmd = "cp $< $@",
)
npm_package(
name = "npm_package",
srcs = [
"README.md",
"index.js",
"package.json",
],
deps = [
":common.bazelrc",
],
)
nodejs_test(
name = "test",
data = [
"test.js",
":npm_package",
"@npm//minimist",
],
entry_point = ":test.js",
)
# TODO(alexeagle): add e2e testing by running bazel in a newly created project
# load("@build_bazel_integration_testing//tools:common.bzl", "GET_LATEST_BAZEL_VERSIONS")
# some_nodejs_bazel_integration_test or use Java/Go existing libraries