GithubHelp home page GithubHelp logo

Comments (8)

i-like-robots avatar i-like-robots commented on September 17, 2024

Thanks for setting up the test case, that makes my life much easier! I'll take a look when I can.

from rewireify.

i-like-robots avatar i-like-robots commented on September 17, 2024

I haven't had time to set this up yet but looking at the code - have you tried switching exports to module.exports? Rewireify assigns the __get__ and __set__ properties on module.exports which takes precedence over exports (see here for more info).

from rewireify.

i-like-robots avatar i-like-robots commented on September 17, 2024

I've had a minute and managed a proper look. Downgrading Rewireify to 0.2.0 in your example app works. This version of Rewireify bundled an old version of the injected __set__ method from Rewire so this may be a bug may be within the Rewire dependency or Rewireify's integration with it.

from rewireify.

jhorneman avatar jhorneman commented on September 17, 2024

Thanks! (module.exports made no difference.)

By the way, I also added the issue over at Rewire: jhnns/rewire#70

I'm glad there is a workaround at least. I was going crazy since this seemed like such a common use case and I wondered what I was doing wrong.

from rewireify.

i-like-robots avatar i-like-robots commented on September 17, 2024

Are you able to run the test runner successfully in your browser (rather than through headless PhantomJS)? Mocking the methods of dependencies is covered in the test suite and is working as expected when in Chrome and Firefox.

from rewireify.

jhnns avatar jhnns commented on September 17, 2024

Function.prototype.bind is undefined in PhantomJS 1.x (See ariya/phantomjs#13107)

from rewireify.

i-like-robots avatar i-like-robots commented on September 17, 2024

Thanks for taking a look @jhnns and figuring it out =D

from rewireify.

jhorneman avatar jhorneman commented on September 17, 2024

Thank you for figuring out what the problem was.

from rewireify.

Related Issues (14)

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.