Closed pygy closed 1 year ago
I'm in the process of implementing this as an opt-in, run-time option. I'll provide o.localAssertions
and o.localAssertions
which can be nested. o.localAssertions(true)
at the root of a test suite will also be valid as a global switch.
o.localAssertions( ()=> {
o("new style", o => {})
o.globalAssertions(()=>{
o("old-style", done => {done()})
})
})
It is currently possible to have assertions that run after the test that defined them, and at that point, ospec is unacle to trace their origin.
One possibility to solve this would be to change the API to something tape-like:
If we were to implement this, we'd need a complimentary codemod to upgrade the test suites. If someone skilled in theses want to step up and write it would be most welcome. Otherwise I'll dive into it.