Skip to content

Commit

Permalink
test: add rspack.default test
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter committed Oct 24, 2024
1 parent 11f20e1 commit 4da05fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/rspack-cli/tests/api/type/js-api-cjs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ describe("js-api-type should be correct when requiring from @rspack/core", () =>
const compiler = rspackCjsNamedRequire({});
assert(compiler);
});

it("rspack.default should not exist in cjs require", async () => {
assert(!(rspackCjsNamedRequire as any).default);
assert(!(rspackCjsRequire as any).default);
});
});
5 changes: 5 additions & 0 deletions packages/rspack-cli/tests/api/type/js-api-esm.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ describe("js-api-type should be correct when importing from @rspack/core", () =>
const compiler = rspackEsmNamedImport({});
assert(compiler);
});

it("rspack.default should not exist in esm import", async () => {
assert(!(rspackEsmNamedImport as any).default);
assert(!(rspackEsmDefaultImport as any).default);
});
});

0 comments on commit 4da05fa

Please sign in to comment.