-
Notifications
You must be signed in to change notification settings - Fork 309
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
"require(...).install is not a function" with Jest 23 #171
Comments
Have you tried the "next" tag? That's one thing. The second is I recall this issue, can you search better on this issue tracker or Google? I'm on a mobile right now, so it's a hard task with Github UI :D |
Hi @PatrickLehnerXI , your issue is caused by |
@thymikee unfortunately, with
Note that the relative reference to @ahnpnl thanks for the hint, but unfortunately, I can't see anything actionable in that ts-jest issue, nor the linked issue in the jest repo. The original poster of kulshekhar/ts-jest#603 finally said that their problem went away but changing the version of one of their other dependencies. TBH this really doesn't speak to the "Zero configuration testing platform" that Jest advertises :( (Unfortunately, since this is for a work project, and we were going to try if Jest is viable for testing Angular apps, I can't spend too much more time on this.) |
@PatrickLehnerXI I think your issue is related to this issue |
hi @PatrickLehnerXI , would you please try to verify if the issue still exists with v6.0.0 just release ? |
@ahnpnl I have the same error but only started to have it after upgrading to v6 |
hi @herkulano , would you please try to clean |
@ahnpnl works! thank you! |
@ahnpnl that worked for me too 👍 |
|
When adding Jest 23, ts-jest 23 and jest-preset-angular 5.2.3 to an Angular 6 app, running tests results in the execution error "
TypeError: require(...).install is not a function
" for each test file.The same works with Jest 22, ts-jest 22 and jest-preset-angular 5.2.3.
Reproduction Steps
ng new test-app
cd test-app
npm install -D jest ts-jest jest-preset-angular
src/setupJest.ts
with contents [1]src/jestGlobalMocks.ts
with contents [2]package.json
[3]npx jest
Expected result:
src/app/app.component.spec.ts
is executed and have 2 passes and 1 failure (like withnpm run test
)Actual result:
src/app/app.component.spec.ts
fails to start with the following error:Additional Notes
Everything works as expected when installing
jest@22
,ts-jest@22
andjest-preset-angular@5.2.2
instead.Reproduction Repo
https://github.com/PatrickLehnerXI/jest-preset-angular-repro-issue171
[1]
src/setupJest.ts
:[2]
src/jestGlobalMocks.ts
:[3] configuration key in
package.json
:The text was updated successfully, but these errors were encountered: