question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Npm test fails on clean clone (Windows)

See original GitHub issue
  • babel-macros version: current master d2ee8fc
  • node version: v8.4.0
  • npm (or yarn) version: 5.3.0 (yarn: v0.21.3)

Getting the following error when running the tests:

Cannot find module 'fake/macro' from 'index.js'

What you did: http://imgur.com/a/50zxy git clone cd babel-macros npm install npm test

What happened: http://imgur.com/a/50zxy

> babel-macros@0.5.2 test [Path/to/babel-macros]
> nps test

nps is executing `test` : jest --coverage
 FAIL  src\__tests__\index.js
  ● Test suite failed to run

    Cannot find module 'fake/macro' from 'index.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:179:17)
      at Object.<anonymous> (src/__tests__/index.js:3:14)

Reproduction repository: This is it!

Problem description: Seems to be something wrong with jest’s mocked module resolution on windows. Importing from fake\\mock works. Babel-jest or jest is probably assuming it’s a path and windows-ifies it.

Suggested solution: Either wait for jest to fix the issue or import without the /.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
erik-inkapoolcommented, Aug 16, 2017
1reaction
kentcdoddscommented, Aug 16, 2017

Seems to be something wrong with jest’s mocked module resolution on windows. Importing from fake\mock works. Babel-jest or jest is probably assuming it’s a path and windows-ifies it.

That’s very interesting! Do you think you could create a small repo that reproduces that issue and file that in jest? Seems like that could be a big issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Engineering] npm run test fails with fresh git clone · Issue #1732
Can't successfully run all the tests for botbuilder-js. To Reproduce. Steps to reproduce the behavior: git clone https://github.com/microsoft/ ...
Read more >
How to solve npm install error “npm ERR! code 1”
try with deleting package-lock.json file and node_module folder then run npm cache clean --force. And try npm i again to install packages. If...
Read more >
Common errors | npm Docs
Some strange issues can be resolved by simply running npm cache clean and trying again. ... Running a Vagrant box on Windows fails...
Read more >
Unit test reports - GitLab Docs
View failed tests ... Each entry in the Test summary panel shows the test name and result type. Select the test name to...
Read more >
Troubleshooting AWS CodeBuild
Error : "This build image requires selecting at least one runtime version. ... Error: "Git clone failed: Unable to access 'your-repository-URL': SSL ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found