Created
April 25, 2018 02:18
-
-
Save xiaoyunyang/8e5a34c564691d1e12a7f1d7eae3b0e2 to your computer and use it in GitHub Desktop.
matchParenTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const test = (fun testCases) => { | |
testCases.map(t => { | |
const shouldBe = t.shouldBe; | |
const is = fun(t.test); | |
const res = (shouldBe === is) ? 'passed' : 'failed'; | |
const moreInfo = (res === 'failed') ? `testing ${t.test}. Should be ${shouldBe} but got ${is}` : '' | |
console.log(`${res} ${moreInfo}`); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment