Skip to content

Commit fd59d53

Browse files
committed
test: fix the test case
1 parent 88c91b9 commit fd59d53

File tree

1 file changed

+6
-2
lines changed
  • packages/rspack-test-tools/tests/configCases/library/modern-module-asset-entry

1 file changed

+6
-2
lines changed

packages/rspack-test-tools/tests/configCases/library/modern-module-asset-entry/rspack.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const assert = require("assert");
2+
13
/** @type {import("@rspack/core").Configuration} */
24
module.exports = {
35
context: __dirname,
@@ -44,8 +46,10 @@ module.exports = {
4446
const js = list.find(item => item.endsWith("js"));
4547
const jsContent = assets[js].source().toString();
4648

47-
/import img_namespaceObject from ['"]\.\/static\/img\/img\.png['"]/.test(jsContent);
48-
/export\s{\simg_namespaceObject\sas\sdefault\s}/.test(jsContent);
49+
const preseveImport = /import img_namespaceObject from ['"]\.\/static\/img\/img\.png['"]/.test(jsContent);
50+
assert(preseveImport);
51+
const hasExports = /export\s{\simg_namespaceObject\sas\sdefault\s}/.test(jsContent);
52+
assert(hasExports);
4953
})
5054
});
5155
}

0 commit comments

Comments
 (0)