Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest is loading the same module twice #4437

Closed
AlokBansal8 opened this issue Sep 6, 2017 · 3 comments
Closed

Jest is loading the same module twice #4437

AlokBansal8 opened this issue Sep 6, 2017 · 3 comments

Comments

@AlokBansal8
Copy link

When I try to run multiple test files using jest, I get following error:

 PASS  src/server/gis/common/value-calculator.test.js
 FAIL  src/server/gis/raster/index.test.js
  ● Test suite failed to run

    TypeError: gdal.config.set is not a function
      
      at Object.<anonymous> (node_modules/gdal/lib/gdal.js:58:14)
      at Object.<anonymous> (src/server/gis/raster/index.js:3:39)
      at Object.<anonymous> (src/server/gis/raster/index.test.js:3:14)
          at <anonymous>

But everything works fine if I run only one test file (whichever it may be).

As per node-gdal library's author this is happening because jest is loading the same module twice in the same process.

npm -v --> 5.3.0
node -v --> 8.4.0
jest version --> 20.0.4

@kentor
Copy link
Contributor

kentor commented Sep 6, 2017

Seems like that module has native bindings, so this is probably related: #3552

@cpojer
Copy link
Member

cpojer commented Sep 6, 2017

Yap, duplicate.

@cpojer cpojer closed this as completed Sep 6, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants