Skip to content

Commit be654a5

Browse files
committed
Ensure that the modules exports are validated in tests
1 parent cd43f05 commit be654a5

File tree

2 files changed

+4
-7
lines changed
  • .github/workflows
  • test/validateModuleExportsMatchCommonJS

2 files changed

+4
-7
lines changed

.github/workflows/CI.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ jobs:
2121
- name: Run tests
2222
run: node ./test/runTests.js
2323

24+
- name: Run tests
25+
run: node ./test/validateModuleExportsMatchCommonJS/index.js
26+
if: matrix.node-version == '14.x'

test/validateModuleExportsMatchCommonJS/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
// When on node 14, it validates that all of the commonjs exports
1+
// This file can only run on node 14+, it validates that all of the commonjs exports
22
// are correctly re-exported for es modules importers.
33

4-
const nodeMajor = Number(process.version.split(".")[0].slice(1))
5-
if (nodeMajor < 14) {
6-
console.log("Skipping because node does not support module exports.")
7-
process.exit(0)
8-
}
9-
104
// ES Modules import via the ./modules folder
115
import * as esTSLib from "../../modules/index.js"
126

0 commit comments

Comments
 (0)