Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

No explanation what to do with configuration file #2546

Open
konrazem opened this issue Nov 17, 2021 · 5 comments
Open

No explanation what to do with configuration file #2546

konrazem opened this issue Nov 17, 2021 · 5 comments

Comments

@konrazem
Copy link

It is not a big issue, however, it is a bit frustrating that I can not find in the "Installation" section what is the best way and how to implement configured enzyme instance in my project:

import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

Enzyme.configure({ adapter: new Adapter() });

If you can give an idea how to handle it it would be nice 😃

@ljharb
Copy link
Member

ljharb commented Nov 17, 2021

That entirely depends on your test framework - and that framework's documentation usually would explain how you do a "setup" file for your test suite.

@konrazem
Copy link
Author

Thanks @ljharb for the fast response. I understand. Even your comment to add to this section I think would be helpful with some examples. Like for create-react-app there is src/setupTests.js file that can do it. There is even issue on stackoverflow

@ljharb
Copy link
Member

ljharb commented Nov 18, 2021

Yes, CRA uses jest, which has its own documentation for how to do a setup file.

A PR to improve the docs is welcome.

@jrachelr
Copy link

@ljharb I can work on this if you want to assign to me

@ljharb
Copy link
Member

ljharb commented Jun 22, 2023

There’s no need for assignment; just make the PR and link it when you’re ready.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants