rules_jasmine
v2.0.0
published 3 months ago
5 stars
3 forks
4 watchers
Apache License 2.0
public
1 assets
139,790 downloads
36 KB
Compatability level 1
DS+cl3hCaFiVAgysch2MxPGzeq4Vr0YSjPYZdB3GFSk=
v2.0.0
August 15, 2024

Using Bzlmod with Bazel 6 or later:

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_jasmine", version = "2.0.0")

Using WORKSPACE

Paste this snippet into your WORKSPACE.bazel file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_jasmine",
    sha256 = "0d2f9c977842685895020cac721d8cc4f1b37aae15af46128cf619741dc61529",
    strip_prefix = "rules_jasmine-2.0.0",
    url = "https://github.com/aspect-build/rules_jasmine/releases/download/v2.0.0/rules_jasmine-v2.0.0.tar.gz",
)

######################
# aspect_rules_jasmine setup #
######################
# Fetches the aspect_rules_jasmine dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.

load("@aspect_rules_jasmine//jasmine:dependencies.bzl", "rules_jasmine_dependencies")

# Fetch dependencies which users need as well
rules_jasmine_dependencies()

load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_register_toolchains")

rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION)

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

npm_translate_lock(
    name = "npm",
    npmrc = "//:.npmrc",
    pnpm_lock = "//:pnpm-lock.yaml",
    verify_node_modules_ignored = "//:.bazelignore",
)

load("@npm//:repositories.bzl", "npm_repositories")

npm_repositories()

What's Changed

Full Changelog: https://github.com/aspect-build/rules_jasmine/compare/v1.2.0...v2.0.0

Deps:
Assets:

Bazel rules for Jasmine

Runs the Jasmine JS testing tool under Bazel.

rules_jasmine is just a part of what Aspect provides:

Installation

Usage

To run just the jasmine tests in a test pattern, you can use bazel test --test_lang_filters=jasmine [target pattern...].

API Docs

See usage examples in the examples/ directory.

Note that the examples rely on code in the /WORKSPACE file in the root of this repo.