Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import Chance from 'chance';
  2.  
  3. const seedGenerator = new Chance()
  4. const seed = process.env.SEED || seedGenerator.hash();
  5.  
  6. const chance = new Chance(seed);
  7.  
  8. const functionUnderTest = (input) => {
  9. return input.veryImportant
  10. }
  11.  
  12. describe('Simple test', () => {
  13. it('Expects something to happen', () => {
  14. const inputString = chance.string();
  15. const testData = {
  16. input: inputString,
  17. expectedOutput: inputString
  18. }
  19. const config = {
  20. veryImportant: testData.input
  21. };
  22. const result = functionUnderTest(config);
  23. expect(result).toBe(testData.expectedOutput);
  24. });
  25. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement