mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-25 03:09:00 -06:00
Pick up the following style rules arrow-body-style arrow-parens arrow-spacing prefer-arrow-callback
19 lines
313 B
JavaScript
19 lines
313 B
JavaScript
// @flow
|
|
|
|
import {test as mtest} from 'mocha';
|
|
|
|
export default function test(n: string, f: () => ?Promise) {
|
|
mtest(n, (done) => {
|
|
try {
|
|
const p = f();
|
|
if (p instanceof Promise) {
|
|
p.then(done, done);
|
|
} else {
|
|
done();
|
|
}
|
|
} catch (ex) {
|
|
done(ex);
|
|
}
|
|
});
|
|
}
|