Skip to content

Commit 2f272a8

Browse files
committed
build: fix typescript integration tests on windows
Ensures that the TypeScript compatibility integration tests can be run locally on Windows w/ Bazel.
1 parent d62aeed commit 2f272a8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

integration/ts-compat/helpers.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const npmPackages = getNpmPackagesFromRunfiles();
1313
// Path to the node modules of the workspace.
1414
const nodeModulesDir = runfiles.resolve('npm/node_modules');
1515
// Path to the generated file that imports all entry-points.
16-
const testFilePath = require.resolve('./import-all-entry-points.ts');
16+
const testFilePath = runfiles.resolveWorkspaceRelative(
17+
'integration/ts-compat/import-all-entry-points.ts');
1718

1819
/**
1920
* Runs the TypeScript compatibility test with the specified tsc binary. The
@@ -36,6 +37,9 @@ exports.runTypeScriptCompatibilityTest = async (tscBinPath) => {
3637

3738
const tscArgs = [
3839
'--strict',
40+
// Disables automatic type resolution. In non-sandbox environments, the node modules
41+
// are accessible and types could end up as part of the program.
42+
'--types',
3943
'--lib', 'es2015,dom',
4044
// Ensures that `node_modules` can be resolved. By default, in sandbox environments the
4145
// node modules cannot be resolved because they are wrapped in the `npm/node_modules` folder

0 commit comments

Comments
 (0)