Giter VIP home page Giter VIP logo

Comments (5)

kevb10 avatar kevb10 commented on July 18, 2024

same here..watching

from firestore-jest-mock.

jayesh-remo avatar jayesh-remo commented on July 18, 2024

any updates here?

from firestore-jest-mock.

sbatson5 avatar sbatson5 commented on July 18, 2024

Are you all calling mockFirebase outside of a describe block? i.e. is it at the top of the file before your tests are written? The hoisting in jest is weird and it requires that mockFirebase be in a describe block that wraps your tests. See the examples in our repo:
https://github.com/Upstatement/firestore-jest-mock/blob/master/__tests__/auth.test.js#L16-L17

If you have an example repo you can point me to, I'm happy to play around

from firestore-jest-mock.

jdziek avatar jdziek commented on July 18, 2024

Hi, sorry for jumping onto that thread like that but you touched on a certain problem im having @sbatson5 with the comment. Can I have multiple "mockFirebase" instances per file im testing in, due to having multiple "describe" blocks? Very often i noticed that the "mockFirebase" conflict with each other even in between of the describes. Mind you, that im using es6 with node 16 which apparently stil doesnt have full support for some mocks and clears in jest annoyingly.

from firestore-jest-mock.

sbatson5 avatar sbatson5 commented on July 18, 2024

Hi, sorry for jumping onto that thread like that but you touched on a certain problem im having @sbatson5 with the comment. Can I have multiple "mockFirebase" instances per file im testing in, due to having multiple "describe" blocks? Very often i noticed that the "mockFirebase" conflict with each other even in between of the describes. Mind you, that im using es6 with node 16 which apparently stil doesnt have full support for some mocks and clears in jest annoyingly.

@jdziek Hmm, yeah I would assume that would work but I've also had issues on the latest node and clearing mocks but haven't had time to dig into it. Honestly, jest's hoisting and inconsistent clearing has been one of the biggest headaches for writing such a large mock class, to the point where I just started writing more but smaller test files

from firestore-jest-mock.

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.