Created
March 21, 2019 00:06
-
-
Save meza/074589a2a12dbe584d464b5f4f540adb to your computer and use it in GitHub Desktop.
Randomised test
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 Chance from 'chance'; | |
const chance = new Chance(); | |
const functionUnderTest = (input) => { | |
return input.veryImportant | |
} | |
describe('Simple test', () => { | |
it('Expects something to happen', () => { | |
const inputString = chance.string(); | |
const testData = { | |
input: inputString, | |
expectedOutput: inputString | |
} | |
const config = { | |
veryImportant: testData.input | |
}; | |
const result = functionUnderTest(config); | |
expect(result).toBe(testData.expectedOutput); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment