mirror of
https://github.com/discourse/discourse.git
synced 2025-02-18 10:42:46 +08:00
DEV: Make component-test afterEach
async aware (#10099)
Before this fix, if a test case was async, `afterEach` callback would be executed immediately, without waiting for the test to finish. 😬
This commit is contained in:
parent
843bf0df75
commit
0e2f7ecfd0
|
@ -55,12 +55,12 @@ export default function(name, opts) {
|
||||||
});
|
});
|
||||||
|
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
try {
|
return opts.test.call(this, assert);
|
||||||
opts.test.call(this, assert);
|
}).finally(() => {
|
||||||
} finally {
|
|
||||||
if (opts.afterEach) {
|
if (opts.afterEach) {
|
||||||
opts.afterEach.call(opts);
|
andThen(() => {
|
||||||
}
|
return opts.afterEach.call(opts);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user