Code Monkey home page Code Monkey logo

Comments (5)

SimenB avatar SimenB commented on May 18, 2024 1

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.

fisker avatar fisker commented on May 18, 2024

@SimenB

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.

fisker avatar fisker commented on May 18, 2024

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.

SimenB avatar SimenB commented on May 18, 2024

Yeah, just module state. Which works fine in Jest, but caching probably messes up for this runner

from jest-light-runner.

fisker avatar fisker commented on May 18, 2024

Is #47 good? Or is there a better solution?

from jest-light-runner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.