Created
March 21, 2019 00:30
-
-
Save meza/fd8fcf73e0a4f24cc3d689675ae8dab7 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 Chance from 'chance'; | |
const seedGenerator = new Chance() | |
const seed = process.env.SEED || seedGenerator.hash(); | |
const chance = new Chance(seed); | |
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