Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter committed Oct 23, 2024
1 parent bd0379f commit b7a600c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/rspack-cli/tests/api/type/js-api-cjs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ const assert = require("node:assert");
describe("js-api-type should be correct when requiring from @rspack/core", () => {
it("cjs require", async () => {
const rspack = require("@rspack/core");
const compiler = rspack({});
assert(rspack.BannerPlugin);
assert(typeof rspack === "function");
const compiler = rspack({});
assert(compiler);
});

it("cjs namedRequire", async () => {
const { rspack } = require("@rspack/core");
const compiler = rspack({});
assert(rspack.BannerPlugin);
assert(typeof rspack === "function");
const compiler = rspack({});
assert(compiler);
});
});
7 changes: 5 additions & 2 deletions packages/rspack-cli/tests/api/type/js-api-esm.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ describe("js-api-type should be correct when importing from @rspack/core", () =>
type Falsy = IsFunction<typeof rspackEsmDefaultImport>;
const falsy: Falsy = false;
falsy;
assert(rspackEsmDefaultImport["BannerPlugin"]);
assert(rspackEsmDefaultImport.BannerPlugin);
});

it("esm named import", async () => {
type Truthy = IsFunction<typeof rspackEsmNamedImport>;
const truthy: Truthy = true;
truthy;
assert(rspackEsmNamedImport["BannerPlugin"]);
assert(rspackEsmNamedImport.BannerPlugin);
assert(typeof rspackEsmNamedImport === "function");
const compiler = rspackEsmNamedImport({});
assert(compiler);
});
});

0 comments on commit b7a600c

Please sign in to comment.