Skip to content

feat: Simpler integration with the new setupFilesAfterEnv jest feature #87

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

Merged
merged 2 commits into from
Jul 3, 2019
Merged

feat: Simpler integration with the new setupFilesAfterEnv jest feature #87

merged 2 commits into from
Jul 3, 2019

Conversation

maraisr
Copy link
Contributor

@maraisr maraisr commented Jul 3, 2019

Off the back of what @kentcdodds is doing over at https://github.com/testing-library/jest-dom and its simple:

// jest.config.js

module.exports = {
   setupFilesAfterEnv: [
       require.resolve('jest-dom/extend-expect'),
   ],
}

I aim to introduce something similar to that, that would alleviate the need for a jest setup file.

Which will allow:

// jest.config.js

module.exports = {
   setupFilesAfterEnv: [
       require.resolve('snapshot-diff/extend-expect'),
   ],
}

Or this at the top of the spec file:

import 'snapshot-diff/extend-expect';

Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, why not. Thanks!

@thymikee
Copy link
Member

thymikee commented Jul 3, 2019

Can you update the docs as well?

@thymikee thymikee merged commit 8cc8f70 into jest-community:master Jul 3, 2019
@maraisr maraisr deleted the feature/expect-extend branch July 3, 2019 07:21
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

Successfully merging this pull request may close these issues.

2 participants