Skip to content

Commit

Permalink
Get tests to work at the expense of setting module to the wrong type …
Browse files Browse the repository at this point in the history
…in package.json.
  • Loading branch information
reddaly committed Jan 16, 2023
1 parent c1f750a commit 8b4ecde
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
37 changes: 28 additions & 9 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
load("@rules_pkg//pkg/private/tar:tar.bzl", "pkg_tar")
load("@aspect_rules_ts//ts:defs.bzl", "ts_config", "ts_project")
load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
load("@aspect_rules_rollup//rollup:defs.bzl", "rollup_bundle")
load("@npm//:defs.bzl", "npm_link_all_packages")
load(":execute.bzl", "concat")
Expand Down Expand Up @@ -184,7 +183,7 @@ ts_project(
ts_project(
name = "tests",
testonly = 1,
tsconfig = "//:tsconfig-app",
tsconfig = "//:tsconfig",
declaration = True,
srcs = [
"shellversion.spec.ts",
Expand All @@ -201,18 +200,38 @@ ts_project(
],
)

rollup_bundle(
name = "shellversion_test_bundle",
entry_point = "shellversion.spec.js",
format = "cjs",
output_dir = False,
deps = [":tests"],
testonly = 1,
)

jasmine_test(
name = "testing",
args = ["*.spec.js"],
name = "test_shellversion",
args = ["shellversion_test_bundle.js"],
data = [
":tests",
":shellversion_test_bundle",
],
)

esbuild(
name = "bundle_esbuild",
entry_point = "entry.ts",
deps = [":entry_lib"],
rollup_bundle(
name = "tilespec_test_bundle",
entry_point = "tilespec.spec.js",
format = "cjs",
output_dir = False,
deps = [":tests"],
testonly = 1,
)

jasmine_test(
name = "test_tilespec",
args = ["tilespec_test_bundle.js"],
data = [
":tilespec_test_bundle",
],
)

rollup_bundle(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
},
"scripts": {
},
"type": "module"
"type": "commonjs"
}

0 comments on commit 8b4ecde

Please sign in to comment.