Skip to content

Enable jest mocking to work properly with npm3. #554

Closed
@jezen

Description

Seeing this issue. Not sure where to begin with it.

Using Jest CLI v0.5.10
 FAIL  __tests__/editor/js/views/ElementsPanel/components/Libraries.react.test.js (1.97s)
● LibrariesComponent › it encountered a declaration exception
  - TypeError: /Users/jgt/Sites/app/node_modules/react-addons-test-utils/index.js: /Users/jgt/Sites/app/node_modules/react/lib/ReactTestUtils.js: /Users/jgt/Sites/app/node_modules/react/lib/React.js: /Users/jgt/Sites/app/node_modules/react/lib/ReactDOM.js: /Users/jgt/Sites/app/node_modules/react/lib/ReactDefaultInjection.js: /Users/jgt/Sites/app/node_modules/react/lib/BeforeInputEventPlugin.js: Cannot read property 'topCompositionEnd' of undefined
        at Object.<anonymous> (node_modules/react/lib/BeforeInputEventPlugin.js:65:33)
        at Object.runContentWithLocalBindings (node_modules/jest-cli/src/lib/utils.js:527:17)
        at Loader._execModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:239:9)
        at Loader.requireModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:902:12)
        at Loader.requireModuleOrMock (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:923:17)
        at Object.<anonymous> (node_modules/react/lib/ReactDefaultInjection.js:14:30)
        at Object.runContentWithLocalBindings (node_modules/jest-cli/src/lib/utils.js:527:17)
        at Loader._execModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:239:9)
        at Loader.requireModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:902:12)
        at Loader.requireModuleOrMock (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:923:17)
        at Object.<anonymous> (node_modules/react/lib/ReactDOM.js:18:29)
        at Object.runContentWithLocalBindings (node_modules/jest-cli/src/lib/utils.js:527:17)
        at Loader._execModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:239:9)
        at Loader.requireModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:902:12)
        at Loader.requireModuleOrMock (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:923:17)
        at Object.<anonymous> (node_modules/react/lib/React.js:14:16)
        at Object.runContentWithLocalBindings (node_modules/jest-cli/src/lib/utils.js:527:17)
        at Loader._execModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:239:9)
        at Loader.requireModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:902:12)
        at Loader.requireModuleOrMock (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:923:17)
        at Object.<anonymous> (node_modules/react/lib/ReactTestUtils.js:17:13)
        at Object.runContentWithLocalBindings (node_modules/jest-cli/src/lib/utils.js:527:17)
        at Loader._execModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:239:9)
        at Loader.requireModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:902:12)
        at Loader.requireModuleOrMock (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:923:17)
        at Object.<anonymous> (node_modules/react-addons-test-utils/index.js:1:115)
        at Object.runContentWithLocalBindings (node_modules/jest-cli/src/lib/utils.js:527:17)
        at Loader._execModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:239:9)
        at Loader.requireModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:902:12)
        at Loader.requireModuleOrMock (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:923:17)
        at Suite.<anonymous> (__tests__/editor/js/views/ElementsPanel/components/Libraries.react.test.js:4:19)
        at env.describe_ (evalmachine.<anonymous>:40:25)
        at env.describe (evalmachine.<anonymous>:27:19)
        at Object.<anonymous> (__tests__/editor/js/views/ElementsPanel/components/Libraries.react.test.js:3:1)
        at Object.runContentWithLocalBindings (node_modules/jest-cli/src/lib/utils.js:527:17)
        at Loader._execModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:239:9)
        at Loader.requireModule (node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:902:12)
        at jasmineTestRunner (node_modules/jest-cli/src/jasmineTestRunner/jasmineTestRunner.js:284:16)
        at node_modules/jest-cli/src/TestRunner.js:379:12

Activity

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

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions