Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement