-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please call "Test Bed.compileComponents" before your tests. #155
Comments
Replicated, tried doing Also tried
Everything seems to work the first time around.. |
Tried with More investigation needed. |
I'm confident enough that this is the correct pattern: beforeEach(async(() => {
return TestUtils.configureIonicTestingModule([Page2])
.compileComponents().then(() => {
fixture = TestBed.createComponent(Page2);
instance = fixture.debugElement.componentInstance;
fixture.detectChanges();
});
}));
afterEach(() => {
fixture.destroy();
});
it('should create page2', async(() => {
expect(fixture).toBeTruthy();
expect(instance).toBeTruthy();
})); However I get:
On the second round |
^ Seems to be working in ng-cli |
Tried moving pages to a subdir of app (ng-cli structure) to no avail |
Copying the ng-cli test component directly into |
using tsconfig.json from ng-cli sorts it. I might try to just use theirs separately for testing rather than merging Ionic's. |
How to reproduce:
ng test --watch
Let the tests run the first time, then make a change to page2.ts
I assume it's something to do with the fact that the files are being watched and not being fully rebuilt each time. Any idea on a solution that would allow us to --watch rather than just running the test manually each time?
The text was updated successfully, but these errors were encountered: