Fix compatibility with safari

This commit is contained in:
sigonasr2 2020-08-30 09:42:42 +09:00
parent b78f58d719
commit d117d5634c

View File

@ -23,26 +23,24 @@ class describe {
this.passedtests = 0; this.passedtests = 0;
this.starttime = 0; this.starttime = 0;
console.log(this.testname) console.log(this.testname)
}
beforeEach = (cb)=>{ this.beforeEach = (cb)=>{
this.beforecb = cb this.beforecb = cb
return this return this
} }
this.it = (checkname,cb)=>{
it = (checkname,cb)=>{ this.starttime = new Date().getTime()
this.starttime = new Date().getTime() console.log("->"+checkname)
console.log("->"+checkname) this.beforecb()
this.beforecb() this.cb=cb;
this.cb=cb; this.cb()
this.cb() return this
return this }
} this.showResults = () =>{
console.log("==============")
showResults = () =>{ console.log("TEST RESULTS: "+TestSuite.passedtests+" passed, "+(TestSuite.totaltests-TestSuite.passedtests)+" failed, "+TestSuite.totaltests+" total")
console.log("==============") console.log("==============")
console.log("TEST RESULTS: "+TestSuite.passedtests+" passed, "+(TestSuite.totaltests-TestSuite.passedtests)+" failed, "+TestSuite.totaltests+" total") }
console.log("==============")
} }
} }