-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Your package is really helpful. Thank you guys.
I my old unit tests i am using $httpBackend with .whenGET mocks.
beforeEach(() => {
inject(function ($injector, _$compile_, _$rootScope_) {
// The injector unwraps the underscores (_) from around the parameter names when matching
$compile = _$compile_;
$rootScope = _$rootScope_;
$httpBackend = $injector.get("$httpBackend");
});
$httpBackend.whenGET("api/langs/gb.json").respond({ "COMMON.HOME": homeName });
$httpBackend.whenGET("api/langs/de.json").respond({});
$httpBackend.whenGET(/^private\/auth\?.*/).respond({});
directiveElem = getCompiledElement();
});
Now i have included apiMock and my unit tests doesn't work any more.
it("should be defined and contiain first list item for home.", function () {
$httpBackend.flush();
expect(directiveElem).toBeDefined();
let olElement = directiveElem.find("ol");
expect(olElement).toBeDefined();
let homeElement = directiveElem.find("li");
expect(homeElement.html()).toContain(homeName);
});
I have tried
apiMockProvider.config({
disable: true
});
but it didn't help.
Metadata
Metadata
Assignees
Labels
No labels