playwright-test
Version:
Run mocha, zora, uvu, tape and benchmark.js scripts inside real browsers with playwright.
29 lines (24 loc) • 456 B
JavaScript
class PwTestController {
constructor() {
this.beforeEnded = false
this.ended = false
this.failed = false
this.env = {}
this.endCalled = false
}
beforeEnd() {
this.beforeEnded = true
}
end(failed = this.failed) {
if (this.endCalled) {
return
}
this.ended = true
this.failed = failed
this.endCalled = true
}
fail() {
this.failed = true
}
}
globalThis.PW_TEST = new PwTestController()