Last active
November 18, 2020 09:38
-
-
Save develohpanda/2cba96a9d34ea1314c943ad12c30e3f2 to your computer and use it in GitHub Desktop.
Conditionally run a unit test in jest
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
it.if = cb => cb() ? it : it.skip; | |
const isPackage = () => process.env.BUNDLE === 'package' | |
describe('suite', () => { | |
it.if(isPackage)('test', () => { | |
// test single | |
}); | |
it.if(isPackage).each([1,2])('test each %s', num => { | |
// test each | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment