Skip to content

Commit

Permalink
test: add rspack.default should not exist test (#8207)
Browse files Browse the repository at this point in the history
test: add rspack.default test
  • Loading branch information
SoonIter authored Oct 24, 2024
1 parent 7f11c4f commit eb1d013
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);
});
});

2 comments on commit eb1d013

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Benchmark detail: Open

Name Base (2024-10-24 6f99ff3) Current Change
10000_development-mode + exec 2.11 s ± 48 ms 2.1 s ± 28 ms -0.25 %
10000_development-mode_hmr + exec 668 ms ± 22 ms 670 ms ± 24 ms +0.38 %
10000_production-mode + exec 2.71 s ± 48 ms 2.68 s ± 39 ms -1.05 %
arco-pro_development-mode + exec 1.8 s ± 66 ms 1.77 s ± 77 ms -1.43 %
arco-pro_development-mode_hmr + exec 426 ms ± 1.6 ms 426 ms ± 2.8 ms -0.00 %
arco-pro_production-mode + exec 3.19 s ± 73 ms 3.21 s ± 96 ms +0.74 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.24 s ± 69 ms 3.28 s ± 60 ms +1.01 %
threejs_development-mode_10x + exec 1.61 s ± 17 ms 1.61 s ± 16 ms +0.01 %
threejs_development-mode_10x_hmr + exec 761 ms ± 20 ms 760 ms ± 20 ms -0.17 %
threejs_production-mode_10x + exec 5.01 s ± 29 ms 5.03 s ± 34 ms +0.35 %

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Ran ecosystem CI: Open

suite result
modernjs ✅ success
_selftest ✅ success
rspress ✅ success
rslib ✅ success
rsbuild ✅ success
examples ✅ success
devserver ✅ success

Please sign in to comment.