Skip to content

Commit f854433

Browse files
committed
test: Fixed issue affecting running tests
1 parent f5e0016 commit f854433

File tree

4 files changed

+829
-772
lines changed

4 files changed

+829
-772
lines changed

test/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"typescript": "latest",
1313
"ts-patch": "link:../node_modules/ts-patch",
1414
"ts-node": "link:../node_modues/ts-node",
15+
"tsp1": "npm:ts-patch@1.*.*",
1516
"@nrwl/cli": "^15.0.0",
1617
"@nrwl/js": "^15.0.0",
1718
"@nrwl/node": "^15.0.0",

test/prepare.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const fs = require("fs");
22
const path = require("path");
33
const tsPatch = require("ts-patch");
4+
const tsp1 = require('tsp1');
45

56
/* ****************************************************************************************************************** *
67
* Config
@@ -13,12 +14,14 @@ const tsDirs = ["typescript-three", "typescript-four-seven", "typescript"];
1314
* Patch TS Modules
1415
* ****************************************************************************************************************** */
1516

16-
const baseDirs = new Set();
17+
const baseDirs = new Map();
1718

1819
for (const tsDirName of tsDirs) {
1920
const mainDir = path.resolve(rootDir, "node_modules", tsDirName);
20-
if (!fs.existsSync(path.join(mainDir, "lib-backup"))) baseDirs.add(mainDir);
21+
if (!fs.existsSync(path.join(mainDir, "lib-backup"))) baseDirs.set(tsDirName, mainDir);
2122
}
2223

2324
// Patch discovered modules
24-
for (const dir of baseDirs) tsPatch.patch(["tsc.js", "typescript.js"], { basedir: dir });
25+
for (const [ dirName, dir ] of baseDirs)
26+
if (dirName === 'typescript-three') tsp1.patch(["tsc.js", "typescript.js"], { basedir: dir })
27+
else tsPatch.patch(["tsc.js", "typescript.js"], { dir });

0 commit comments

Comments
 (0)