Skip to content

Commit

Permalink
build: ensure source maps are used for jasmine stack traces
Browse files Browse the repository at this point in the history
`rules_js` doesn't integrate source maps by default, so we are enabling it by default via `defaults2.bzl`.
  • Loading branch information
devversion authored and alan-agius4 committed Jan 20, 2025
1 parent e5e0947 commit 2114f02
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools/defaults2.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ def ts_project(**kwargs):
def npm_package(**kwargs):
_npm_package(**kwargs)

def jasmine_test(**kwargs):
def jasmine_test(data = [], **kwargs):
# Create relative path to root, from current package dir. Necessary as
# we change the `chdir` below to the package directory.
relative_to_root = "/".join([".."] * len(native.package_name().split("/")))

_jasmine_test(
node_modules = "//:node_modules",
chdir = native.package_name(),
args = ["**/*.js"],
args = [
"--require=%s/node_modules/source-map-support/register.js" % relative_to_root,
"**/*.js",
],
data = data + ["//:node_modules/source-map-support"],
**kwargs
)

0 comments on commit 2114f02

Please sign in to comment.