Files
yarn/__tests__/_parallel-test.js
Yehuda Katz 7ba8cfadb6 Get add tests passing on Windows
This commit also fixes a few rebase conflicts
2016-09-21 19:57:31 -07:00

15 lines
346 B
JavaScript

/* @flow */
export default function(title: string, fn: () => ?Promise<any>, test?: typeof it = it) {
let promise;
try {
// first run the test
promise = fn();
} catch (error) {
promise = Promise.reject(error);
}
// then register a test with existing (already running) promise
test(title, (): ?Promise<any> => promise);
}