-
-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,8 @@ | ||
const { checkChunkModules } = __non_webpack_require__("@rspack/test-tools"); | ||
|
||
it('should compile', async () => { | ||
const [v1, v2] = await Promise.all([ | ||
import('./dyn-1').then(m => m.default), | ||
import('./dyn-2').then(m => m.default) | ||
]) | ||
expect(v1.default).toBe('shared') | ||
expect(v2.default).toBe('shared') | ||
|
||
checkChunkModules(STATS_JSON, { | ||
'dyn-1': [ | ||
'dyn-1.js', | ||
'm.js' | ||
], | ||
'dyn-2': [ | ||
'dyn-2.js', | ||
], | ||
shared: [ | ||
'shared.js', | ||
'm.js', | ||
] | ||
}) | ||
}) |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const { checkChunkModules } = require("@rspack/test-tools"); | ||
|
||
module.exports = { | ||
checkStats(stepName, stats) { | ||
switch (stepName) { | ||
case '0': | ||
checkChunkModules(stats, { | ||
'dyn-1': [ | ||
'dyn-1.js', | ||
'm.js' | ||
], | ||
'dyn-2': [ | ||
'dyn-2.js', | ||
], | ||
shared: [ | ||
'shared.js', | ||
'm.js', | ||
] | ||
}) | ||
break | ||
case '1': | ||
checkChunkModules(stats, { | ||
'dyn-1': [ | ||
'dyn-1.js', | ||
'm.js' | ||
], | ||
'dyn-2': [ | ||
'dyn-2.js', | ||
'm.js' | ||
], | ||
shared: [ | ||
'shared.js', | ||
] | ||
}) | ||
break; | ||
default: | ||
throw "no have more step" | ||
} | ||
|
||
return true | ||
} | ||
} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export default 'v'; | ||
export default 1; |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
const { checkChunkModules } = require("@rspack/test-tools"); | ||
|
||
module.exports = { | ||
checkStats(stepName, stats) { | ||
switch (stepName) { | ||
case '0': | ||
checkChunkModules(stats, { | ||
'dyn-1': [ | ||
'dyn-1.js', | ||
'm.js', | ||
], | ||
shared: [ | ||
'shared.js', | ||
] | ||
}) | ||
break | ||
case '1': | ||
checkChunkModules(stats, { | ||
'dyn-1': [ | ||
'dyn-1.js', | ||
'm.js' | ||
], | ||
'dyn-2': [ | ||
'dyn-2.js', | ||
], | ||
shared: [ | ||
'shared.js', | ||
'm.js' | ||
] | ||
}) | ||
break; | ||
case '2': | ||
checkChunkModules(stats, { | ||
'dyn-1': [ | ||
'dyn-1.js', | ||
'm.js' | ||
], | ||
'dyn-2': [ | ||
'dyn-2.js', | ||
'm.js' | ||
], | ||
shared: [ | ||
'shared.js', | ||
] | ||
}) | ||
break; | ||
default: | ||
throw "no have more step" | ||
} | ||
|
||
return true | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,8 @@ | ||
const { checkChunkModules } = __non_webpack_require__("@rspack/test-tools"); | ||
|
||
it('should compile', async () => { | ||
const [v1, v2] = await Promise.all([ | ||
import('./dyn-1').then(m => m.default), | ||
import('./dyn-2').then(m => m.default) | ||
]) | ||
expect(v1.default).toBe('shared') | ||
expect(v2.default).toBe('shared') | ||
|
||
checkChunkModules(STATS_JSON, { | ||
'dyn-1': [ | ||
'dyn-1.js', | ||
'm.js' | ||
], | ||
'dyn-2': [ | ||
'dyn-2.js', | ||
], | ||
shared: [ | ||
'shared.js', | ||
'm.js', | ||
] | ||
}) | ||
}) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
const { checkChunkModules } = __non_webpack_require__("@rspack/test-tools"); | ||
|
||
it('should compile', async () => { | ||
const v1 = await import('./dyn-1').then(m => m.default) | ||
expect(v1.default).toBe('shared') | ||
|
||
checkChunkModules(STATS_JSON, { | ||
'dyn-1': [ | ||
'dyn-1.js', | ||
'm.js' | ||
], | ||
shared: [ | ||
'shared.js', | ||
] | ||
}) | ||
}) |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,8 @@ | ||
const { checkChunkModules } = __non_webpack_require__("@rspack/test-tools"); | ||
|
||
it('should compile', async () => { | ||
const [v1, v2] = await Promise.all([ | ||
import('./dyn-1').then(m => m.default), | ||
import('./dyn-2').then(m => m.default) | ||
]) | ||
expect(v1.default).toBe('shared') | ||
expect(v2.default).toBe('shared') | ||
|
||
checkChunkModules(STATS_JSON, { | ||
'dyn-1': [ | ||
'dyn-1.js', | ||
'm.js' | ||
], | ||
'dyn-2': [ | ||
'dyn-2.js', | ||
'm.js' | ||
], | ||
shared: [ | ||
'shared.js', | ||
] | ||
}) | ||
}) |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.