diff --git a/test/hotCases/esm-output/css-modules/index.js b/test/hotCases/esm-output/css-modules/index.js index e4511d95a..83344fef4 100644 --- a/test/hotCases/esm-output/css-modules/index.js +++ b/test/hotCases/esm-output/css-modules/index.js @@ -1,29 +1,30 @@ import * as styles from "./style.module.css"; import update from "../../update.esm"; +import.meta.webpackHot.accept(["./style.module.css", "./style2.module.css"]) + it("should work", async function (done) { expect(styles).toMatchObject({ class: "_style_module_css-class" }); - const styles2 = await import("./style2.module.css"); expect(styles2).toMatchObject({ foo: "_style2_module_css-foo" }); - import.meta.webpackHot.accept(["./style.module.css", "./style2.module.css"], () => { - expect(styles).toMatchObject({ + NEXT(update(done, true, () => { + Promise.all([ + import("./style.module.css"), + import("./style2.module.css") + ]) + .then(([styles, styles2]) => { + expect(styles).toMatchObject({ "class-other": "_style_module_css-class-other" - }); - import("./style2.module.css").then(styles2 => { + }); expect(styles2).toMatchObject({ "bar": "_style2_module_css-bar" }); done(); - }); - }); - - NEXT(update(done)); -}); - -module.hot.accept(); + }).catch(done); + })); +}); \ No newline at end of file diff --git a/test/hotCases/esm-output/split-chunks/index.js b/test/hotCases/esm-output/split-chunks/index.js index 706146c99..dcdbf928c 100644 --- a/test/hotCases/esm-output/split-chunks/index.js +++ b/test/hotCases/esm-output/split-chunks/index.js @@ -8,7 +8,6 @@ it("should handle HMR with split chunks in ESM format", (done) => { ]).then(([commonModule, vendorModule]) => { expect(commonModule.commonFunction("test")).toBe("Common function processed: test"); expect(vendorModule.default.version).toBe("1.0.0"); - done(); }).catch(done); NEXT(update(done, true, () => {