Npm test fails on clean clone (Windows)
See original GitHub issuebabel-macros
version: current master d2ee8fcnode
version: v8.4.0npm
(oryarn
) 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:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Created https://github.com/facebook/jest/issues/4284 for babel-jest.
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!