fava
Version:
A wannabe tiny largely-drop-in replacement for ava that works in the browser too.
22 lines (21 loc) • 821 B
JavaScript
/* IMPORT */
import { NOOP } from './constants.js';
import Describer from './describer.js';
import Enhancer from './enhancer.js';
import Register from './register.js';
import Tester from './tester.js';
/* MAIN */
// This file exists to avoid creating cyclic dependencies, while still providing fresh goods
const Factory = {
/* API */
makeDescribe: () => Enhancer.withHooks(Enhancer.withFlags((flags, title, implementation = NOOP) => {
const describer = new Describer(title, flags.flags);
Register.describer(describer, implementation);
})),
makeTest: () => Enhancer.withHooks(Enhancer.withFlags((flags, title, implementation = NOOP) => {
const tester = new Tester(title, implementation, flags.flags);
Register.tester(tester);
}))
};
/* EXPORT */
export default Factory;