Skip to content

Commit

Permalink
fix hot test cases for async-node
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Oct 27, 2020
1 parent f07f64b commit 2b964c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
it("should create a conditional import when accepted", done => {
if (Math.random() < 0) new Worker(new URL("worker.js", import.meta.url));
import("./module")
.then(module => module.test(done))
.then(module =>
module.test(callback => {
NEXT(require("../../update")(done, undefined, callback));
}, done)
)
.catch(done);
});
12 changes: 5 additions & 7 deletions test/hotCases/conditional-runtime/accept-conditional/module.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { f } from "./shared";

export function test(done) {
export function test(next, done) {
expect(f()).toBe(42);
NEXT(
require("../../update")(done, undefined, () => {
expect(f()).toBe(43);
done();
})
);
next(() => {
expect(f()).toBe(43);
done();
});
}

0 comments on commit 2b964c6

Please sign in to comment.