Comments (5)
I think that's good. It might make sense for Jest to expose some sort of "reset serializers" API which reset the array to the default (happy to take a PR)? But with the current API I think your approach is good
from jest-light-runner.
Can you help me understand how addSnapshotSerializer
works? Does expect.extend
create a new instance? How to remove snapshot serializer or restore state?
In this Prettier PR, we use addSnapshotSerializer()
in some test, but seems all tests using that.
I'm calling createExpect on each test, but not working as expected.
Thank you!
The failing test, that snapshot serializer replace \
to /
from jest-light-runner.
Ah, found this https://github.com/facebook/jest/blob/main/packages/jest-snapshot/src/plugins.ts#L39, so I can backup it and restore after test?
from jest-light-runner.
Yeah, just module state. Which works fine in Jest, but caching probably messes up for this runner
from jest-light-runner.
Is #47 good? Or is there a better solution?
from jest-light-runner.
Related Issues (20)
- Feature request: Support `expect.addSnapshotSerializer()`
- Support "snapshotResolver" configuration option HOT 1
- jest.setTimeout is not a function HOT 1
- "Your test suite must contain at least one test" with --runInBand and --watch
- incompatibility: wrong nested beforeEach execution order HOT 2
- @jest/globals alternative HOT 2
- `afterEach` and `afterAll` should be run after test blocks HOT 1
- Perhaps `jest.concurrent` can be supported?
- Not updating snapshot correctly
- it works with esmock and ts-node! wow! HOT 1
- Slower than Jest HOT 3
- Unclear how to integrate in typescript projects HOT 1
- Evaluate using tinypool over piscina
- Document shared modules between tests
- Jest aliases `xit` / `xdescribe` not implemented HOT 1
- Test case duration only reported as `NaN`
- jsdom environment
- beforeAll, beforeEach, afterEach, afterAll do not work from setupFilesAfterEnv HOT 2
- Expand documentation on coverage report setup
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jest-light-runner.