Skip to content

Instantly share code, notes, and snippets.

@xiaoyunyang
Created April 25, 2018 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiaoyunyang/8e5a34c564691d1e12a7f1d7eae3b0e2 to your computer and use it in GitHub Desktop.
Save xiaoyunyang/8e5a34c564691d1e12a7f1d7eae3b0e2 to your computer and use it in GitHub Desktop.
matchParenTest
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