daml/language-support/ts/jest.bzl
Gary Verhaegen a925f0174c
update copyright notices for 2021 (#8257)
* update copyright notices for 2021

To be merged on 2021-01-01.

CHANGELOG_BEGIN
CHANGELOG_END

* patch-bazel-windows & da-ghc-lib
2021-01-01 19:49:51 +01:00

30 lines
1.0 KiB
Python

# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load("@language_support_ts_deps//jest-cli:index.bzl", _jest_test = "jest_test")
load("@os_info//:os_info.bzl", "is_windows")
def jest_test(name, srcs, deps, jest_config = ":jest.config.js", tsconfig = ":tsconfig.json", **kwargs):
"Macro for TypeScript test suites with jest"
args = [
"--no-cache",
"--no-watchman",
"--ci",
]
args.extend(["--config", "$(location %s)" % jest_config])
for src in srcs:
args.extend(["--runTestsByPath", "$(locations %s)" % src])
jest_deps = [
"@language_support_ts_deps//@types/jest",
"@language_support_ts_deps//jest",
"@language_support_ts_deps//ts-jest",
"@language_support_ts_deps//typescript",
] if not is_windows else []
_jest_test(
name = name,
data = [jest_config, tsconfig] + srcs + deps + jest_deps,
args = args,
**kwargs
) if not is_windows else None