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

Make tests pass using Node 5 / NPM 3 #832

Closed
steveluscher opened this issue Feb 12, 2016 · 6 comments
Closed

Make tests pass using Node 5 / NPM 3 #832

steveluscher opened this issue Feb 12, 2016 · 6 comments

Comments

@steveluscher
Copy link
Contributor

Right now, if you npm install using Node >=5 and NPM >=3 you'll run into a bunch of problems.

Most of these are due to the fact that npm installs dependencies in a flat directory structure, which makes the paths in unmockedModulePathPatterns (see package.json) no longer match.

Another problem is that the paths in our .flowconfig files may no longer match.

There are undoubtedly other problems.

The task is to make npm test pass all-green with both NPM 2 & 3, or make it pass exclusively with NPM 3 and update the engines config in package.json if dual-compatibility is too much of a pain.

@raineroviir
Copy link
Contributor

I'll give this a try

@raineroviir
Copy link
Contributor

I removed the nesting node_modules in unmockedModulePathPatterns and I'm at
75 tests failed, 1092 tests passed (1167 total in 96 test suites, run time 62.275s)

@steveluscher
Copy link
Contributor Author

Related: jestjs/jest#554

@raineroviir
Copy link
Contributor

Okay so based on that issue and also related: facebook/react#5183, the issue is with jest and to solve it you unmock all the deps, except for 3 packages that are needed to pass the tests.
I set the package.json to look like:

"unmockedModulePathPatterns": [
      "<rootDir>/node_modules/(?!(fbjs/lib/ErrorUtils.js$|fbjs/lib/fetch.js$|fbjs/lib/fetchWithRetries.js$))"
    ]

1167 tests passed (1167 total in 96 test suites, run time 60.464s) 🎉

raineroviir pushed a commit to raineroviir/relay that referenced this issue Feb 15, 2016
raineroviir pushed a commit to raineroviir/relay that referenced this issue Feb 15, 2016
raineroviir pushed a commit to raineroviir/relay that referenced this issue Feb 15, 2016
raineroviir pushed a commit to raineroviir/relay that referenced this issue Feb 15, 2016
raineroviir pushed a commit to raineroviir/relay that referenced this issue Feb 15, 2016
raineroviir pushed a commit to raineroviir/relay that referenced this issue Feb 15, 2016
Make tests pass using Node 5 / NPM 3 facebook#832

Make tests pass using Node 5 / NPM 3 facebook#832

Make tests pass using Node 5 / NPM 3 facebook#832
@cpojer
Copy link
Contributor

cpojer commented Feb 22, 2016

I'll publish a new version of jest-cli@next today that should resolve the npm3 mocking issues.

ghost pushed a commit to jestjs/jest that referenced this issue Feb 22, 2016
Summary:This fixes unmock resolution for node_modules when using npm3. The way this is solved is by checking whether the parent dependency is unmocked and both modules are within a `node_modules` folder.

This has taken a while, mainly because it required #599 to be merged. I also added some more caching that makes test runs even faster. The react-native test suite now completes in about 6s (down from 7.5-8s). There might be more in the near future ;)

This fixes #554, #730, facebook/react#5183, facebook/relay#832 and will be part of 0.9.0. I'll publish 0.9.0-fb3 today with this fix.
Closes #732

Differential Revision: D2959610

fb-gh-sync-id: c374b7a2bcdfddf768905356a08948d9156eb028
shipit-source-id: c374b7a2bcdfddf768905356a08948d9156eb028
ghost pushed a commit that referenced this issue Feb 24, 2016
Summary:0.9.0-fb3 comes with all those sweet npm3 fixes. Also see #840 and #832.

Tests are passing for me on node4 both with npm2 and npm3.

See jestjs/jest@7b44ca0 and jestjs/jest@2d10421

cc kassens raineroviir
Closes #877

Differential Revision: D2971806

fb-gh-sync-id: 85f2898f71df12eaf7f2b4bd6a2e641305453b45
shipit-source-id: 85f2898f71df12eaf7f2b4bd6a2e641305453b45
ghost pushed a commit that referenced this issue Feb 26, 2016
Summary: Closes #840

Reviewed By: yungsters

Differential Revision: D2981190

fb-gh-sync-id: a16e9c1b8cc1bd23513a5c4d9181c7612355f291
shipit-source-id: a16e9c1b8cc1bd23513a5c4d9181c7612355f291
@kassens
Copy link
Member

kassens commented May 9, 2016

We've been running node 5 for a while on travis by now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants