Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. export const processListOfItems = (input): [] => {
  2. let listOfItems = [];
  3. for (var index = 0; index < rawPayload.length; ++index) {
  4. listOfItems.push(someFunction(item));
  5. }
  6. return listOfItems;
  7. };
  8.  
  9. describe('someFunction fails on an item', () => {
  10. it('returns the array with the rest of the items', () => {
  11. const items = ['hi', 'hello'];
  12.  
  13. const someFunctionStub = sinon.stub(someFunction).returns(42);
  14.  
  15. expect(getListOfItems(items)).toEqual([42, 42]);
  16. });
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement