Skip to content

Commit 8a71e61

Browse files
committed
tests: refining env tests
1 parent d74a802 commit 8a71e61

File tree

22 files changed

+6
-267
lines changed

22 files changed

+6
-267
lines changed

.github/workflows/test-env.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
matrix:
2121
tsModuleResolution: [ "node", "node16", "nodenext" ]
2222
tsModule: [ "commonjs", "es2020" ]
23-
pkgType: [ "module", "commonjs" ]
2423

2524
steps:
2625
- name: Use Node.js
@@ -36,8 +35,8 @@ jobs:
3635
- name: Copy tests to working directory
3736
run: cp faux_modules/ethers/testcases/test-env/test-tsc/* .
3837

39-
- name: Prepare setup moduleResolution=${{ matrix.tsModuleResolution }} module=${{ matrix.tsModule }} type=${{ matrix.pkgType }}
40-
run: node prepare.cjs ${{ matrix.tsModuleResolution }} ${{ matrix.tsModule }} ${{ matrix.pkgType }}
38+
- name: Prepare setup moduleResolution=${{ matrix.tsModuleResolution }} module=${{ matrix.tsModule }}
39+
run: node prepare.cjs ${{ matrix.tsModuleResolution }} ${{ matrix.tsModule }}
4140

4241
- name: Dump Config
4342
run: cat package.json tsconfig.json

testcases/test-env/test-3983/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

testcases/test-env/test-3983/index.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

testcases/test-env/test-3983/package.json

Lines changed: 0 additions & 29 deletions
This file was deleted.

testcases/test-env/test-3983/tsconfig.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

testcases/test-env/test-tsc/prepare.cjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ replace("tsconfig.json", "${TS_MODULE_RESOLUTION}", process.argv[2]);
1212
// module: commonjs, es2020
1313
replace("tsconfig.json", "${TS_MODULE}", process.argv[3]);
1414

15-
// type: module, commonjs
16-
replace("package.json", "${PKG_TYPE}", process.argv[4]);
15+
// type: commonjs, module
16+
const type = (process.argv[3] === "commonjs") ? "commonjs": "module";
17+
replace("package.json", "${PKG_TYPE}", type);
1718

1819
// JavaScript
19-
fs.writeFileSync("index.ts", fs.readFileSync("js-" + process.argv[4] + ".ts"));
20+
fs.writeFileSync("index.ts", fs.readFileSync("js-" + type + ".ts"));

testcases/test-env/ts-import-cjs-node16/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

testcases/test-env/ts-import-cjs-node16/index.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

testcases/test-env/ts-import-cjs-node16/package.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

testcases/test-env/ts-import-cjs-node16/tsconfig.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)