Closed benjaminbhm closed 7 years ago
Hi @benjaminbhm, Can you, please copy the full test file because I can't see the initialisation of your tests.
Here is an example test that will fail with version 2.0.5
and 2.0.7
(I assume 2.0.6
as well), but will work correctly with version 2.0.4
:
import { inject, TestBed } from '@angular/core/testing';
// Load the implementations that should be tested
import { AppComponent } from './app.component';
import { Router, Event, NavigationStart, NavigationEnd, NavigationCancel, NavigationError } from '@angular/router';
import { AppSettings } from './app.settings';
import { MockRouter } from './mocks';
import { MockVHTranslateLoader } from './utils/translate-loader.mock';
import { ViewContainerRef } from '@angular/core';
import { SlimLoadingBarService } from 'ng2-slim-loading-bar';
describe('App', () => {
// provide our implementations or mocks to the dependency injector
beforeEach(() => TestBed.configureTestingModule({
imports: [
MockVHTranslateLoader.getImports()
],
providers: [AppComponent,
ViewContainerRef,
{ provide: Router, useClass: MockRouter },
SlimLoadingBarService]
}));
it('can instantiate app component', inject([AppComponent], (app: AppComponent) => {
expect(app).toBeDefined();
}));
});
Fixed in 2.4.0
I'm submitting a ... (check one with "x")
Current behavior It makes some Tests fail for unknown Reason, here are some outputs of failing tests:
Expected/desired behavior Those Test should not fail. It worked perfectly fine with the version 2.0.4, which we are currently using for a temporary fix
Reproduction of the problem If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar.
As we do not know the reason for the failing tests, I will just copy paste some tests into here.
Example Test:
What is the expected behavior? All tests should run fine
What is the motivation / use case for changing the behavior?
Please tell us about your environment: Mac OS X Sierra 10.12.2 Angular 2 Project, Jasmine with Karma Plugin as Testing framework
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]