Skip to content

Commit fb708b3

Browse files
test(css): propagate assertion failures from the async callback
Passing done as the rejection handler does not catch a throw from the fulfillment handler, so a failed expectation timed out with no message.
1 parent e8a72d0 commit fb708b3

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

  • test/configCases/css/no-async-css-loading-runtime

test/configCases/css/no-async-css-loading-runtime/index.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import "./style.css";
22

3-
it("should apply the initial stylesheet", done => {
3+
it("should apply the initial stylesheet", () => {
4+
const style = getComputedStyle(document.body);
5+
expect(style.getPropertyValue("background")).toBe(" red");
6+
});
7+
8+
it("should load a javascript-only chunk", done => {
49
import("./lazy.js").then(({ default: value }) => {
5-
expect(value).toBe(42);
6-
const style = getComputedStyle(document.body);
7-
expect(style.getPropertyValue("background")).toBe(" red");
8-
done();
10+
try {
11+
expect(value).toBe(42);
12+
done();
13+
} catch (err) {
14+
done(err);
15+
}
916
}, done);
1017
});
1118

0 commit comments

Comments
 (0)
Sponsor
SponsoredKunjungi sekarang
Promo