jest icon indicating copy to clipboard operation
jest copied to clipboard

Can't find modules that end with '.node'

Open johnhaley81 opened this issue 11 years ago • 6 comments

In NodeGit we include the native module via these lines. The key part is that we're using require('../build/Release/nodegit') and not including the '.node` at the end. This will break Jest when including this in any file.

johnhaley81 avatar May 05 '15 23:05 johnhaley81

+1

xcatliu avatar Jun 13 '15 02:06 xcatliu

I have the same problem with using Jest with https://www.npmjs.com/package/fibers.

ghost avatar Jul 31 '15 02:07 ghost

Turns out that Jest has the option moduleFileExtensions where you can add the "node" extension. Just add this to your package.json.

"jest": {
  "moduleFileExtensions": ["js", "json", "node"]
}

I think that should be the default.

ghost avatar Aug 05 '15 10:08 ghost

This will be fixed in the next release of jest, node was added as a default!

cpojer avatar Nov 05 '15 03:11 cpojer

I'm still facing this is issue on jest v23.4.1. Adding node to moduleFileExtensions resolved the issue.

shashankKeshava avatar May 15 '19 19:05 shashankKeshava

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[bot] avatar May 11 '21 23:05 github-actions[bot]