KO
|
EN
gitlite โ search
Search
#typescript
#ai-agents
#ai
#dsh-plugin
#deepseek-harness
#open-source
#cli
#claude-code
#codex
#developer-tools
#react
#windows
how-jest-mocking-works
โ 316
Open GitHub โ
No description available.
Download README (.md)
Explore Similar Repositories
inboard
:
๐ข Docker images and utilities to power your Python APIs and help you ship faster. With support for Uvicorn, Gunicorn, Starlette, and FastAPI.
k8s
:
Platform In a Box!
nutter
:
Testing framework for Databricks notebooks
naszilla
:
Naszilla is a Python library for neural architecture search (NAS)
Spark-SQL-on-HBase
:
Native, optimized access to HBase Data through Spark SQL/Dataframe Interfaces
// repository documentation
Was this content helpful?
โ 0
(0 ratings)
Select Rating:
โ
โ
โ
โ
โ
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
how-jest-mocking-works
?
Download (.md)
# How Jest Mocking Works This title is a bit misleading. I'm not explaining everything about Jest mocking, just something I wanted to test out and thought was kind of interesting. So it turns out that if you make a call to `jest.mock` in the root of your module, that mocking will take place before any require statements are resolved/run. This actually makes Jest's mocking capabilities really powerful! It essentially means that you can import all the stuff you would normally, and not worry about whether you're mocking things in time. Pretty legit! And Christoph [comes in](https://twitter.com/cpojer/status/795729860819820544) to give a little more insight here :) Looks like you can use `jest.doMock` or `jest.dontMock` to change this behavior. 