kentcdodds / nps-utils

Utilities for http://npm.im/nps (npm-package-scripts)
https://doclets.io/kentcdodds/nps-utils/master
MIT License
101 stars 23 forks source link

"npm start validate" fails on untouched (fresh) fork #12

Closed ghost closed 6 years ago

ghost commented 7 years ago

Hi, just wanted to add a neat feature for this repo but... validation fails on an untouched code.

Apologies, but don't have time to dig what's happening there ;-/

kentcdodds commented 7 years ago

Hi. Thanks for trying things out. This doesn't give me enough information to know what the problem actually was. If you could paste the entire output from npm start validate that would be very helpful.

ghost commented 7 years ago

@kentcdodds sorry for no slow response. Here you go the dump of npm start validate:

output ``` > nps-utils@0.0.0-semantically-released start /Users/dabrowskif/Documents/nps-utils > nps "validate" nps executing: node node_modules/concurrently/src/main.js --kill-others-on-fail --prefix-colors "bgBlue.bold,bgMagenta.bold,bgGreen.bold" --prefix "[{name}]" --names "lint,build,test" 'nps lint' 'nps build' 'nps test' [lint] nps executing: eslint . [build] nps executing: rimraf dist && babel --copy-files --out-dir dist --ignore *.test.js src [test] nps executing: jest --coverage [build] src/index.js -> dist/index.js [build] nps build exited with code 0 [lint] nps lint exited with code 0 [test] FAIL src/index.test.js [test] ● crossEnv as darwin [test] [test] expect(value).toMatchSnapshot() [test] [test] Received value does not match stored snapshot 1. [test] [test] - "node node_modules/cross-env/bin/cross-env.js NODE_ENV=test jest" [test] + "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=test jest" [test] [test] at Object. (src/index.test.js:58:37) [test] [test] ● crossEnv as win32 [test] [test] expect(value).toMatchSnapshot() [test] [test] Received value does not match stored snapshot 1. [test] [test] - "node node_modules/cross-env/bin/cross-env.js NODE_ENV=test jest" [test] + "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=test jest" [test] [test] at Object. (src/index.test.js:62:37) [test] [test] ✓ series as darwin (63ms) [test] ✓ series as win32 (11ms) [test] ✓ series.nps as darwin (9ms) [test] ✓ series.nps as win32 (12ms) [test] ✓ concurrent as darwin (9ms) [test] ✓ concurrent as win32 (9ms) [test] ✓ concurrent.nps as darwin (8ms) [test] ✓ concurrent.nps as win32 (9ms) [test] ✓ runInNewWindow as darwin (10ms) [test] ✓ runInNewWindow as win32 (8ms) [test] ✓ runInNewWindow.nps as darwin (9ms) [test] ✓ runInNewWindow.nps as win32 (10ms) [test] ✓ rimraf as darwin (7ms) [test] ✓ rimraf as win32 (7ms) [test] ✓ ifWindows as darwin (7ms) [test] ✓ ifWindows as win32 (7ms) [test] ✓ ifNotWindows as darwin (7ms) [test] ✓ ifNotWindows as win32 (7ms) [test] ✓ copy as darwin (7ms) [test] ✓ copy as win32 (9ms) [test] ✓ mkdirp as darwin (10ms) [test] ✓ mkdirp as win32 (8ms) [test] ✓ open as darwin (8ms) [test] ✓ open as win32 (7ms) [test] ✕ crossEnv as darwin (10ms) [test] ✕ crossEnv as win32 (7ms) [test] ✓ commonTags as darwin (7ms) [test] ✓ commonTags as win32 (8ms) [test] [test] ----------|----------|----------|----------|----------|----------------| [test] File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | [test] ----------|----------|----------|----------|----------|----------------| [test] All files | 100 | 95.83 | 100 | 100 | | [test] index.js | 100 | 95.83 | 100 | 100 | | [test] ----------|----------|----------|----------|----------|----------------| [test] Jest: Coverage for branches (95.83%) does not meet global threshold (100%) [test] Snapshot Summary [test] › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run with `npm start -- -u` to update them. [test] [test] Test Suites: 1 failed, 1 total [test] Tests: 2 failed, 26 passed, 28 total [test] Snapshots: 2 failed, 26 passed, 28 total [test] Time: 0.841s, estimated 2s [test] Ran all test suites. [test] The script called "test" which runs "jest --coverage" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.0.5/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code [test] nps test exited with code 1 ```
kentcdodds commented 7 years ago

Are you sure you're on the latest of master? Oh, what it could also be is you have an outdated cross-env version. Could you reinstall all dependencies? Let me know.

ghost commented 7 years ago

@kentcdodds just cloned it again just to be sure ;-) Still same errors.

Version of cross-env: cross-env@3.2.4

kentcdodds commented 7 years ago

Could you look to see whether there's a file in node_modules/cross-env/bin/cross-env.js? There shouldn't be. It should be in node_modules/cross-env/dist/bin/cross-env.js.

macklinu commented 6 years ago

I just checked out this repo and was able to run the test and validate scripts successfully. Might be worth closing unless this can be reproduced?