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
testing beyond React 17 - consider replacing enzyme #40
Labels
Comments
brodybits
added
bug
Something isn't working
help wanted
Extra attention is needed
labels
Jan 26, 2023
brodybits
added a commit
that referenced
this issue
Jan 26, 2023
with a number of test cases not working, as discussed in: - #40
brodybits
added a commit
that referenced
this issue
Jan 26, 2023
with a number of test cases not working, as discussed in: - #40 - #41 how to test React 18 from command line (as specified in the new CI workflow): yarn add --dev react@18 react-dom@18 enzyme-adapter-react-16@npm:@cfaester/enzyme-adapter-react-18 npx cross-env TEST_WITH_REACT_18=1 jest how to test Preact from command line: yarn add --dev react@npm:@preact/compat react-dom@npm:@preact/compat enzyme-adapter-react-16@npm:enzyme-adapter-preact-pure preact@latest npx cross-env TEST_WITH_PREACT=1 jest Preact guides for reference: - https://preactjs.com/guide/v10/switching-to-preact/ - https://preactjs.com/guide/v10/getting-started/#aliasing-react-to-preact - https://preactjs.com/guide/v10/unit-testing-with-enzyme/
brodybits
added a commit
that referenced
this issue
Jan 26, 2023
with a number of test cases not working, as discussed in: - #40 - #41 how to test React 18 from command line (as specified in the new CI workflow): yarn add --dev react@18 react-dom@18 enzyme-adapter-react-16@npm:@cfaester/enzyme-adapter-react-18 npx cross-env TEST_WITH_REACT_18=1 jest how to test Preact from command line: yarn add --dev react@npm:@preact/compat react-dom@npm:@preact/compat enzyme-adapter-react-16@npm:enzyme-adapter-preact-pure preact@latest npx cross-env TEST_WITH_PREACT=1 jest Preact guides for reference: - https://preactjs.com/guide/v10/switching-to-preact/ - https://preactjs.com/guide/v10/getting-started/#aliasing-react-to-preact - https://preactjs.com/guide/v10/unit-testing-with-enzyme/
brodybits
added a commit
that referenced
this issue
Jan 31, 2023
- wrap some updates in act() wrapper from react-dom/test-utils (or preact/test-utils for Preact), using simple actWith() test utility function in many cases, to get some tests working with Preact & React 18 - update CI workflow labels - show console warnings for tests that still need to be skipped - other minor updates related issues: - #40 - #41
This was referenced Jan 31, 2023
brodybits
added a commit
that referenced
this issue
Jan 31, 2023
- wrap some updates in act() wrapper from react-dom/test-utils (or preact/test-utils for Preact), using simple actWith() test utility function in many cases, to get some tests working with Preact & React 18 (without breaking on React 16) - update CI workflow labels - show console warnings for tests that still need to be skipped - other minor updates related issues: - #40 - #41 PR ref: #48
brodybits
changed the title
testing beyond React 17 - may need to replace enzyme
testing beyond React 17 - consider replacing enzyme
Feb 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
UPDATED STATUS:
ref:
Alternatives I can think of:
@cfaester/enzyme-adapter-react-18
- mostly done except for 1 test in 6afc637 (PR [WIP] update some dev dependencies & regenerate yarn.lock - DRAFT CLOSED in favor of PR #19 #18) ✅d: support React 18 but only test with React 17- 👎 👎 ❌e: "start fresh, forgetting that Enzyme has ever existed" (quoting https://dev.to/wojtekmaj/enzyme-is-dead-now-what-ekl)- 👎 👎 👎 - I think throwing existing tests away is dangerous for confidence in future refactoring 👎 ❌The text was updated successfully, but these errors were encountered: