Extract nullreporter
parent
7bde58b5ed
commit
b8ee7685fc
11
index.js
11
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())
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
const nullreporter = {
|
||||
start: (title) => { },
|
||||
before: () => { },
|
||||
success: (test) => { },
|
||||
fail: (test, e) => { },
|
||||
after: () => { },
|
||||
end: (stats) => { },
|
||||
}
|
||||
|
||||
export { nullreporter }
|
Loading…
Reference in New Issue