diff --git a/index.js b/index.js index 59961a9..9f31037 100644 --- a/index.js +++ b/index.js @@ -1,11 +1,4 @@ -const noreporter = { - start: (title) => { }, - before: () => { }, - success: (test) => { }, - fail: (test, e) => { }, - after: () => { }, - end: (stats) => { }, -} +import { nullreporter } from './reporter/nullreporter.js' const metaltest = (title) => { const suite = [] @@ -27,7 +20,7 @@ const metaltest = (title) => { runner.after = (fn) => { after.push(fn) } runner.run = async (...reporters) => { - const rs = reporters.map(r => Object.assign({}, noreporter, r)) + const rs = reporters.map(r => Object.assign({}, nullreporter, r)) rs.forEach(r => r.start(title)) rs.forEach(r => r.before()) diff --git a/reporter/nullreporter.js b/reporter/nullreporter.js new file mode 100644 index 0000000..f47bc90 --- /dev/null +++ b/reporter/nullreporter.js @@ -0,0 +1,10 @@ +const nullreporter = { + start: (title) => { }, + before: () => { }, + success: (test) => { }, + fail: (test, e) => { }, + after: () => { }, + end: (stats) => { }, +} + +export { nullreporter } \ No newline at end of file