SHARE
TWEET

Untitled

a guest Apr 21st, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. it('should enter the assertion', inject(
  2.         [ MockBackend, CellService ],
  3.         ( backend: MockBackend, s: CellService ) => {
  4.             const urls = [];
  5.  
  6.             backend.connections.subscribe((connection: MockConnection) => {
  7.                 const req = connection.request;
  8.                 urls.push(req.url);
  9.                 if (req.method === RequestMethod.Get && req.url === '/api/getTest') {
  10.                     connection.mockRespond(new Response(new ResponseOptions('enter mocked content')));
  11.                 }
  12.             });
  13.             s.getCell('powders').subscribe(val => expect(true).toBeFalsy())
  14.         })
  15.     );
RAW Paste Data
Top