Skip to content

Problems with isInBrowser() and jsdom #102

@asgerhallas

Description

@asgerhallas

I use jsdom for testing some jQuery functionality using node and when installing source-map-support, I get the problem, that the isInBrowser() function returns true, though I'm really only faking it. And then it can't load the source maps.

I have two suggestions for fixing this:

  1. Only check for browser-capabilities on construction and let isInBrowser be constant. That way I could simply just install jsdom after source-map-support. And I can't think of any other way isInBrowser could change from call to call.
  2. Make an option on install to force either node or browser behavior.

I would be happy to make a PR if any of the above solutions seems ok to you :)

And great project by the way!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions