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

Test with Jest and Enzyme Internal Error #1651

Closed
soraliu opened this issue Feb 19, 2020 · 3 comments
Closed

Test with Jest and Enzyme Internal Error #1651

soraliu opened this issue Feb 19, 2020 · 3 comments

Comments

@soraliu
Copy link

soraliu commented Feb 19, 2020

🐞 bug report

Affected Rule

The issue is caused by the rule:
load("@npm//jest-cli:index.bzl", _jest_test = "jest_test")

I referred to the official example jest.

Description

It works with only Jest, but my project also use Enzyme to do some e2e test. With Enzyme it throw that error. I find some anwser in Enzyme such as enzyme #1437. But I'm sure there is no another enzyme in my project.

$ npm ls enzyme
root
└── enzyme@3.11.0

🔥 Exception or Error


  ● Test suite failed to run

    Enzyme Internal Error: configured enzyme adapter did not inherit from the EnzymeAdapter base class

      2 | import Adapter from 'enzyme-adapter-react-16'
      3 |
    > 4 | Enzyme.configure({
        |        ^
      5 |   adapter: new Adapter(),
      6 | })
      7 |

      at validateAdapter (node_modules/enzyme/src/validateAdapter.js:43:11)
      at Object.merge [as configure] (node_modules/enzyme/src/configuration.js:11:5)
      at Object. (setupTests.ts:4:8)
          at Array.forEach ()

🌍 Your Environment

Operating System:

  
Darwin 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64
  

Output of bazel version:

  
Bazelisk version: v1.3.0
Build label: 2.1.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Feb 7 13:04:00 2020 (1581080640)
Build timestamp: 1581080640
Build timestamp as int: 1581080640
  

Rules_nodejs version:

(Please check that you have matching versions between WORKSPACE file and @bazel/* npm packages.)

  
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "build_bazel_rules_nodejs",
    sha256 = "b6670f9f43faa66e3009488bbd909bc7bc46a5a9661a33f6bc578068d1837f37",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.3.0/rules_nodejs-1.3.0.tar.gz"],
)
  
@soraliu
Copy link
Author

soraliu commented Feb 19, 2020

Hope somebody can help me. Thanks a lot.

@mrmeku

@noveyak
Copy link
Contributor

noveyak commented Apr 15, 2020

Just wanted to add I ran into this issue as well, upgrading to 1.6 seems to have fixed it.

Thanks!

@gregmagolan
Copy link
Collaborator

Thanks for the report @noveyak. Linker fixes in 1.6.0 would have covered this case.

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

No branches or pull requests

3 participants