Last active
August 7, 2017 17:55
-
-
Save justinobney/39729b5704dfd5c7d12322d6158f2c8a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 cases = (testName, ...testCases) => (test) => testCases.forEach(args=>it(testName, async () => test(...args))); | |
describe('Test Cases', () => { | |
const multiply = (x,y) => x*y; | |
cases( | |
'can multiply things...', | |
[1,2,2], | |
[2,2,4], | |
[3,3,9], | |
)((x,y,expected) => { | |
expect(multiply(x,y)).toEqual(expected); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment