-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(examples): Add context examples #68
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
feat(examples): Add context examples #68
Conversation
examples/README.md
Outdated
how they might appear in your project. (You'll see in the tests that we can | ||
`import {render} from 'react-testing-library'`). | ||
|
||
Another thing that we do for the tests is we have a `setup-test-env.js` file in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be made a bit more obvious by putting it in jest.setup.js
or something more similar to how Jest is typically configured?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never heard of jest.setup.js
before. I'm not sure how much more obvious that is. Though I did consider just adding import 'jest-dom/extend-expect'
in every file that needs the extensions to make it more obvious. That's probably the best idea. I'll do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it's fine as-is. I think maybe long-term the examples should drop the dependency on kcd-scripts to show a more direct Jest config, but that can be done later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm about jest.setup.js
- it was manually referenced in my jest config, not automatic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we need to have an example repo (somewhere else) that shows a good setup. Maybe one that uses create-react-app as well. We could just link to those in the examples.
examples/jest.config.js
Outdated
setupTestFrameworkScriptFile: require.resolve('../other/setup-test-env'), | ||
moduleNameMapper: { | ||
// this is just here so our examples look like they would in a real project | ||
'react-testing-library': require.resolve('../src'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 this is cool
a34ca90
to
6ed3fc1
Compare
6ed3fc1
to
8c4579c
Compare
Whelp, I'm not sure what's up with codecov, but this is good to go! |
🎉 This PR is included in version 2.4.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Haha, whoops, this probably didn't need to be released 😅 Oh well. |
What:
Why:
How:
Checklist: