How to use Protractor.addMockModule in the e2e test

I have a typescript test:

describe ('User should be able to login', () => {

beforeEach(()=> {
browser.addMockModule('mockLogin', function() {
angular.module('mockLogin', []).value('foo', 'bar');
});

My modName is a typescript class:

export class mockLogin {
... some code
}

I want to use that class but I get complilation error cannot find name angular.

2
Leave a Reply

avatar
2 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Jason Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Jason
Guest

addMockModule does not currently work for Angular2 applications. Look for updates in this issue:

Jason
Guest

When I did mocking, I used: https://github.com/kbaltrinic/http-backend-proxy

Maybe you could try using that instead of using the addMockModule functionality.