Closed munrocket closed 3 years ago
not sure to understand what would be the expected behavior if your tests are spread into various files 🤔 would you have to add the wrapper on every test file ?
You can have something similar in the userland without introducing a breaking change here (and I am more comfortable with that idea ):
// ex: test-utils.js (or can be published as a package on top of zora
import {createHarness} from 'zora';
export withReporter = (reporter) => {
const harness= createHarness();
// auto-start reporting if that is what you want:
setTimeout(() => { harness.report({ reporter }) },0);
// export the test function or the whole API if needed
return harness.test;
}
// then in your project: 'test-harness.js'
export const test = withReporter(someReporter);
// and in your spec files
import {test} from './test-harness.js';
/*
test(`...`, t => {});
etc
*/
:c
Thanks for creating zora-reporters and supporting zora! I am using Zora in all my personal projects! I think it will be cool to change this
To something like this
This
hold
andreport
doesn't make sense to me. Anyway I am happy that we have ES6 reporters now.