-
Notifications
You must be signed in to change notification settings - Fork 306
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
entryComponents with Angular 9 (Ivy) #353
Comments
Ok, so this is related to I think Ivy and its ASTTransformers are doing more under the hood to gather the metadata for entry components.
Until then, I guess you have to declare it in |
FYI, according to ts-jest source code it only takes into account of transformers which are manually defined by users (via ts-jest config). It doesn’t know anything about angular. I wonder if providing angular transformers to ts-jest can solve the issue (point 1) I agree that we need to know what ivy does to find out a proper way. (point 2) |
Can you verify whether |
It was using the TestBedViewEngine , after manually transforming the code, the test passes.
|
related to the discussion in #347, see explanation |
It should only be necessary to run |
I don't know what I did wrong on Sunday, but after running |
Ngcc should only modify internal angular codes I think, so run once should be enough to be compatible with Ivy and it’s unrelated to the project’s code base. |
|
I can confirm that I was able to override
I added beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [LedgerComponent, VerifyLedgerComponent],
imports: [LedgerCoreModule, MatDialogModule, NoopAnimationsModule],
schemas: [NO_ERRORS_SCHEMA]
})
.overrideModule(BrowserDynamicTestingModule, {
set:
{entryComponents: [VerifyLedgerComponent]}
})
.compileComponents();
})); |
Closes #108 Closes #288 Closes #322 Closes #353 Closes #622 BREAKING CHANGE: With the new jest transformer, `jest-preset-angular` now switches to default to use this new transformer and no longer uses `ts-jest` to transform codes. Users who are currently doing in jest config ``` // jest.config.js module.exports = { // [...] transform: { '^.+\\.(ts|js|html)$': 'ts-jest', }, } ``` should change to ``` // jest.config.js module.exports = { // [...] transform: { '^.+\\.(ts|js|html)$': 'jest-preset-angular', }, } ``` `isolatedModule: true` will still use `ts-jest` to compile `ts` to `js` but you won't get full compatibility with Ivy.
With Angular 9 (Ivy), we no longer have to provide
entryComponents
.This seems to fail if we're using Jest as our test runner.
The same test does pass with Jasmine/Karma.
If we run it with Jest, we're getting the following error
See https://github.com/timdeschryver/jest-dynamic-ng-repro for a reproduction.
The text was updated successfully, but these errors were encountered: