question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to disable global-mocks on jest builder

See original GitHub issue

Describe the Bug

I’m having problems with the global mocks configured, I would like to disable them. Could be posible to provide an option in angular.json to disable it?

Minimal Reproduction

I think it isn’t needed

Expected Behavior

And option to disable the mocks applied

Screenshots

If applicable, add screenshots to help explain your problem.

Environment


Libs
- @angular/core version: latest
- @angular-devkit/build-angular version: latest
- @angular-builders/jest version: latest

For Tooling issues:
I think it isn't needed

Others:
None

## Additional Context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
klinemcommented, Feb 1, 2021

Just to add to this, I was running into some trouble using @testing-library/angular and its accessibility selectors. The getComputedStyle mock seems to to interfere with discoverability of accessible elements.

3reactions
just-jebcommented, Apr 7, 2020

Thanks @tonivj5 . Just FYI you’re not forgotten, I have a proper solution in mind just need to find time to implement it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Option to disable global-mocks on jest builder -
I'm having problems with the global mocks configured, I would like to disable them. Could be posible to provide an option in angular.json...
Read more >
@angular-builders/jest - npm
Start using @angular-builders/jest in your project by running `npm i ... want to disable one or more of these mocks just pass an...
Read more >
jestjs - Can't run tests in a Angular 9 project - Stack Overflow
In my opinion, the main reason for jest to not work is the mismatch between the version of jest , jest-preset-angular , @angular-builders/jest...
Read more >
Setup Unit Testing Tools in Angular CLI Project
You may find details how to change the builder options here. Setup Jest in our Project​. We create a config file in project's...
Read more >
ES6 Class Mocks - Jest
... of the class, this is the easiest option to set up. ... Jest will disable this check for variables that start with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found