Git Product home page Git Product logo

Comments (3)

robertknight avatar robertknight commented on May 20, 2024

Thank-you for the detailed bug report 🙂. The stack trace you posted points to this line. In a browser environment, self refers to window. In Node however, there is no global variable called self.

That code looks a bit odd to me, it apparently relates to preactjs/preact#1590 though.

So in brief, the issue is with the Preact library rather than the Enzyme adapter.

from enzyme-adapter-preact-pure.

robertknight avatar robertknight commented on May 20, 2024

I filed an issue with the Preact library. For now a workaround is to set the self global variable to point to the window object in your fake DOM environment, eg. with global.self = <window from JSDOM>.

from enzyme-adapter-preact-pure.

ingro avatar ingro commented on May 20, 2024

Thanks for the fast reply, wasn't sure if the issue was more related to preact or the adapter. Your workaround seems to work nicely, I'll use it until they fix the bug in preact, keep up the good work!

from enzyme-adapter-preact-pure.

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.