diff --git a/internal/linker/test/issue_1823_use_ts_library_esm/.babelrc b/internal/linker/test/issue_1823_use_ts_library_esm/.babelrc deleted file mode 100644 index af2cb75a9a..0000000000 --- a/internal/linker/test/issue_1823_use_ts_library_esm/.babelrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presets": [ - [ - "@babel/preset-env", - { - "targets": { - "node": "current", - }, - }, - ], - ] -} \ No newline at end of file diff --git a/internal/linker/test/issue_1823_use_ts_library_esm/BUILD.bazel b/internal/linker/test/issue_1823_use_ts_library_esm/BUILD.bazel deleted file mode 100644 index 2b8d30426a..0000000000 --- a/internal/linker/test/issue_1823_use_ts_library_esm/BUILD.bazel +++ /dev/null @@ -1,50 +0,0 @@ -load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin") -load("//packages/typescript:index.bzl", "ts_library") -load(":ts_jest_test.bzl", "ts_jest_test") - -ts_library( - name = "lib", - srcs = [ - "lib.ts", - ], - # NB: hacky hidden configuration setting so that es6_sources does not include tsickle - # .externs.js outputs - runtime = "nodejs", - deps = [ - "@npm//@types/node", - ], -) - -# Shenanigans for Windows which doesn't have runfiles symlinks -# We need the jest config to be in the output tree where the specs are -copy_to_bin( - name = "jest_config", - srcs = [ - "jest.config.js", - ], -) - -# Same goes for babelrc. We can't add it to the jest_config copy_to_bin -# since must be a file that is passed to jest in the --config arg. -copy_to_bin( - name = "babel_rc", - srcs = [ - ".babelrc", - ], -) - -ts_jest_test( - name = "test", - srcs = [ - "lib.test.ts", - ], - data = [ - ":babel_rc", - ], - jest_config = ":jest_config", - deps = [ - ":lib", - "@npm//@babel/preset-env", - "@npm//babel-jest", - ], -) diff --git a/internal/linker/test/issue_1823_use_ts_library_esm/jest.config.js b/internal/linker/test/issue_1823_use_ts_library_esm/jest.config.js deleted file mode 100644 index a29201ecef..0000000000 --- a/internal/linker/test/issue_1823_use_ts_library_esm/jest.config.js +++ /dev/null @@ -1,18 +0,0 @@ -const isWindows = process.platform === 'win32'; - -module.exports = { - testEnvironment: 'node', - transform: {'^.+\\.mjs?$': 'babel-jest'}, - // More Shenanigans for Windows where jest is running both the original .mjs & the babel - // transformed .js and fails. Not sure what why this is the case or exactly why changing - // testMatch solves it but not a priority to solve: - // ``` - // PASS ../../lib.test.js - // FAIL ../../lib.test.mjs - // C:\b\swkzcapm\execroot\build_bazel_rules_nodejs\bazel-out\x64_windows-fastbuild\bin\internal\linker\test\issue_1823_use_ts_library_esm\lib.test.mjs:1 - // import { doStuff } from './lib'; - // ^^^^^^ - // ``` - testMatch: [isWindows ? '**/?(*.)(spec|test).js?(x)' : '**/?(*.)(spec|test).?(m)js?(x)'], - moduleFileExtensions: ['js', 'mjs'], -}; diff --git a/internal/linker/test/issue_1823_use_ts_library_esm/lib.test.ts b/internal/linker/test/issue_1823_use_ts_library_esm/lib.test.ts deleted file mode 100644 index 0ea73f6237..0000000000 --- a/internal/linker/test/issue_1823_use_ts_library_esm/lib.test.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {doStuff} from './lib'; - -describe('doStuff', () => { - it('should do some stuff', () => { - expect(doStuff('boom')).toContain('boom'); - }); -}); diff --git a/internal/linker/test/issue_1823_use_ts_library_esm/lib.ts b/internal/linker/test/issue_1823_use_ts_library_esm/lib.ts deleted file mode 100644 index d7318214c4..0000000000 --- a/internal/linker/test/issue_1823_use_ts_library_esm/lib.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function doStuff(a: string): string { - return a -} \ No newline at end of file diff --git a/internal/linker/test/issue_1823_use_ts_library_esm/ts_jest_test.bzl b/internal/linker/test/issue_1823_use_ts_library_esm/ts_jest_test.bzl deleted file mode 100644 index 92f39313c5..0000000000 --- a/internal/linker/test/issue_1823_use_ts_library_esm/ts_jest_test.bzl +++ /dev/null @@ -1,38 +0,0 @@ -"""Simple macro around jest_test""" - -load("@npm//jest-cli:index.bzl", _jest_test = "jest_test") -load("//packages/typescript:index.bzl", "ts_library") - -def ts_jest_test(name, srcs, jest_config, deps = [], data = [], **kwargs): - """A macro around the autogenerated jest_test rule that takes typescript sources - -Uses ts_library prodmode ems output""" - - ts_library( - name = "%s_ts" % name, - srcs = srcs, - data = data, - deps = deps + ["@npm//@types/jest"], - # NB: hacky hidden configuration setting so that es6_sources does not include tsickle - # .externs.js outputs - runtime = "nodejs", - ) - native.filegroup( - name = "%s_esm" % name, - srcs = [":%s_ts" % name], - output_group = "es6_sources", - ) - - args = [ - "--no-cache", - "--no-watchman", - "--ci", - ] - args.extend(["--config", "$$(rlocation $(rootpath %s))" % jest_config]) - - _jest_test( - name = name, - data = [jest_config, ":%s_esm" % name] + deps + data, - templated_args = args, - **kwargs - )