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

Missing peer dependency, object-assign? #2218

Closed
ffxsam opened this issue Dec 5, 2016 · 6 comments
Closed

Missing peer dependency, object-assign? #2218

ffxsam opened this issue Dec 5, 2016 · 6 comments

Comments

@ffxsam
Copy link

ffxsam commented Dec 5, 2016

Versions:
node: 4.6.2
npm: 2.5.11
jest: 17.0.3

I'm getting this error when running a test:

 FAIL  imports/common-ui/components/__tests__/ArtistTrackUI.js
  ● Test suite failed to run

    Cannot find module 'object-assign' from 'ReactTestRenderer.js'

      at Resolver.resolveModule (node_modules/jest/node_modules/jest-cli/node_modules/jest-resolve/build/index.js:151:17)
      at Object.<anonymous> (node_modules/react-test-renderer/lib/ReactTestRenderer.js:15:15)
      at Object.<anonymous> (node_modules/react-test-renderer/index.js:3:18)

I apparently need to install object-assign manually? Should this not be a peer dependency for jest?

Full debug output below:

jest version = 17.0.3
test framework = jasmine2
config = {
  "moduleNameMapper": [
    [
      "^meteor/(.*)",
      "/Volumes/SuperData/Sites/reelcrafter/.meteor-mocks/$1.js"
    ]
  ],
  "rootDir": "/Volumes/SuperData/Sites/reelcrafter",
  "name": "-Volumes-SuperData-Sites-reelcrafter",
  "setupFiles": [],
  "testRunner": "/Volumes/SuperData/Sites/reelcrafter/node_modules/jest/node_modules/jest-cli/node_modules/jest-jasmine2/build/index.js",
  "transform": [
    [
      "^.+\\.jsx?$",
      "/Volumes/SuperData/Sites/reelcrafter/node_modules/babel-jest/build/index.js"
    ]
  ],
  "usesBabelJest": true,
  "automock": false,
  "bail": false,
  "browser": false,
  "cacheDirectory": "/var/folders/5h/1l7pvm3d30qg92qtfgfscrh40000gn/T/jest",
  "coveragePathIgnorePatterns": [
    "/node_modules/"
  ],
  "coverageReporters": [
    "json",
    "text",
    "lcov",
    "clover"
  ],
  "expand": false,
  "globals": {},
  "haste": {
    "providesModuleNodeModules": []
  },
  "mocksPattern": "__mocks__",
  "moduleDirectories": [
    "node_modules"
  ],
  "moduleFileExtensions": [
    "js",
    "json",
    "jsx",
    "node"
  ],
  "modulePathIgnorePatterns": [],
  "noStackTrace": false,
  "notify": false,
  "preset": null,
  "resetMocks": false,
  "resetModules": false,
  "snapshotSerializers": [],
  "testEnvironment": "jest-environment-jsdom",
  "testPathDirs": [
    "/Volumes/SuperData/Sites/reelcrafter"
  ],
  "testPathIgnorePatterns": [
    "/node_modules/"
  ],
  "testRegex": "(/__tests__/.*|\\.(test|spec))\\.jsx?$",
  "testURL": "about:blank",
  "timers": "real",
  "transformIgnorePatterns": [
    "/node_modules/"
  ],
  "useStderr": false,
  "verbose": null,
  "watch": false,
  "cache": true,
  "watchman": true
}
@ffxsam
Copy link
Author

ffxsam commented Dec 5, 2016

After installing object-assign, there are still more issues:

  ● Test suite failed to run

    Cannot find module 'fbjs/lib/invariant' from 'ReactComponentEnvironment.js'

      at Resolver.resolveModule (node_modules/jest/node_modules/jest-cli/node_modules/jest-resolve/build/index.js:151:17)
      at Object.<anonymous> (node_modules/react-test-renderer/lib/ReactComponentEnvironment.js:16:17)
      at Object.<anonymous> (node_modules/react-test-renderer/lib/ReactTestRenderer.js:21:33)

@northin
Copy link

northin commented Dec 5, 2016

i have the same error aaaaaaaa

@cpojer
Copy link
Member

cpojer commented Dec 5, 2016

I've seen this before but I don't think it is a Jest issue. Probably something related to React or your node modules folder. Upgrading to npm3 will probably solve your issue – maybe the React team forgot to add object-assign as explicit dependency to the test renderer? @spicyj can you help us out here?

@sophiebits
Copy link
Contributor

That seems possible. Opened facebook/react#8500.

@ffxsam
Copy link
Author

ffxsam commented Dec 5, 2016

I see a fix is coming down in a future release. Thanks!

@github-actions
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants