Skip to content

Commit

Permalink
chore: align more tests (#5558)
Browse files Browse the repository at this point in the history
chore: init
  • Loading branch information
h-a-n-a authored Feb 1, 2024
1 parent c829ab4 commit 40241c9
Show file tree
Hide file tree
Showing 30 changed files with 604 additions and 532 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ webpack-test
examples
diffcases
scripts/test/diff.cjs
scripts/test/binary-path.cjs
1 change: 1 addition & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ extend-exclude = [
"GOVERNANCE.md",
"pnpm-lock.yaml",
"scripts/test/diff.cjs",
"scripts/test/binary-path.cjs",
]

[default.extend-words]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
it("should compile", () => {
// See: https://github.com/web-infra-dev/rspack/pull/5397
const url = new URL("./index.css?query=yes#fragment", import.meta.url).href;
expect(url).toBeDefined();
});

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions packages/rspack/tests/helpers/FakeDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class FakeElement {
this._document._onElementAttached(node);
this._children.push(node);
node.parentNode = this;
// CHANGE: TODO description
if (node._type === "link" || node._type === "script") {
setTimeout(() => {
if (node.onload) node.onload({ type: "load", target: node });
Expand Down
3 changes: 1 addition & 2 deletions packages/rspack/tests/hotCases/errors/events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ it("should fire the correct events", done => {
}

waitForUpdate(() => {
const error = msg =>
const error = msg =>
expect.objectContaining({
message: msg
});

expect(events).toEqual([
{
type: "unaccepted",
Expand Down
5 changes: 1 addition & 4 deletions packages/rspack/tests/hotCases/errors/events/k.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ export default i;
if (module.hot) {
module.hot.accept(
"./i",
() => {
// TODO remove this
__webpack_require__("./i.js");
},
() => {},
(err, { moduleId, dependencyId }) => {
throw new Error(
`Error in accept error handler: ${moduleId} -> ${dependencyId}`
Expand Down
1 change: 1 addition & 0 deletions packages/rspack/tests/hotCases/fake-update-loader.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = function (content) {
// CHANGE:
var idx = this.getOptions().updateIndex;
var items = content.split(/---+\r?\n/g);
if (items.length > 1) {
Expand Down
5 changes: 0 additions & 5 deletions packages/rspack/tests/hotCases/invalidate/during-idle/a.js

This file was deleted.

7 changes: 0 additions & 7 deletions packages/rspack/tests/hotCases/invalidate/during-idle/b.js

This file was deleted.

11 changes: 0 additions & 11 deletions packages/rspack/tests/hotCases/invalidate/during-idle/c.js

This file was deleted.

20 changes: 0 additions & 20 deletions packages/rspack/tests/hotCases/invalidate/during-idle/index.js

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions packages/rspack/tests/watchCases/simple/simple/0/index.js

This file was deleted.

This file was deleted.

This file was deleted.

Loading

1 comment on commit 40241c9

@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-02-01 e4dc2f4) Current Change
10000_development-mode + exec 1.7 s ± 14 ms 1.69 s ± 39 ms -0.68 %
10000_development-mode_hmr + exec 950 ms ± 10 ms 913 ms ± 15 ms -3.89 %
10000_production-mode + exec 2.75 s ± 46 ms 2.7 s ± 42 ms -2.05 %
arco-pro_development-mode + exec 2.69 s ± 32 ms 2.68 s ± 42 ms -0.51 %
arco-pro_development-mode_hmr + exec 1.09 s ± 16 ms 1.07 s ± 13 ms -2.19 %
arco-pro_production-mode + exec 4.29 s ± 57 ms 4.31 s ± 30 ms +0.54 %
threejs_development-mode_10x + exec 1.99 s ± 25 ms 1.91 s ± 27 ms -3.88 %
threejs_development-mode_10x_hmr + exec 1.23 s ± 14 ms 1.13 s ± 15 ms -7.65 %
threejs_production-mode_10x + exec 5.81 s ± 40 ms 5.63 s ± 32 ms -3.17 %

Please sign in to comment.