Skip to content

Commit f02d4dd

Browse files
committed
feat(esm): Update smoke tests
1 parent 521386d commit f02d4dd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: npm run test
3232
- name: Import with CJS
3333
if: ${{ always() }}
34-
run: node smoke-tests/smoke-test-cjs.js
34+
run: node smoke-tests/smoke-test-cjs.cjs
3535
- name: Import with ESM
3636
if: ${{ always() }}
3737
run: node smoke-tests/smoke-test-esm.mjs

smoke-tests/smoke-test.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ const assert = require("node:assert");
55
const { TypeScriptLoader: esm } = await import("../dist/esm/index.mjs");
66
const { TypeScriptLoader: cjs } = require("../dist/cjs/index.cjs");
77

8-
assert.strictEqual(esm, cjs, "esm === cjs");
8+
// Assert the functions loaded by checking their names load and types are correct
9+
assert.strictEqual(esm.name === "TypeScriptLoader", true);
10+
assert.strictEqual(typeof esm === "function", true);
11+
assert.strictEqual(cjs.name === "TypeScriptLoader", true);
12+
assert.strictEqual(typeof cjs === "function", true);
913

1014
// Try to create loaders
1115
esm();

0 commit comments

Comments
 (0)