Created
August 10, 2023 20:18
-
-
Save Kamilnaja/f27fd8531efc996ce33b5dfb4a71619c 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
import { it } from '@jest/globals'; | |
import { divide } from './it.each'; | |
describe('it.each', () => { | |
it.each([ | |
[1, 2, '0.5'], | |
[12, 3, '4'], | |
[1, 4, '0.25'], | |
[4, 0, ''], | |
])( | |
'should add number %d to number %d to give result %s', | |
(a, b, expected) => { | |
expect(divide(a, b)).toBe(expected); | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment