Advertisement
boris-ivanov

Untitled

Jul 16th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. describe('Utils', () => {
  2. let arr;
  3. const { join } = require('./../utils.js');
  4. beforeEach(() => {
  5. arr = [[100, 'a'], [20, 'b'], [6, 'c'], [4, 'd']];
  6.  
  7. });
  8. describe('join should', () => {
  9. it('return a string', () => {
  10. // Arrange & Act
  11. const str =arr.join(',');
  12. // Assert
  13. expect(arr).not.toEqual(str);
  14. });
  15.  
  16. it(`return a string concated with: ${','} `, () => {
  17. // Arrange & Act
  18. const str = arr.join(',');
  19.  
  20. // Assert
  21.  
  22.  
  23.  
  24. let i = 0;
  25. while (i < arr.length)
  26. {
  27. expect(str[i]).toEqual(arr.join(',')[i]);
  28. i++;
  29. }
  30. });
  31. });
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement