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

add serializer file #777

Merged
merged 5 commits into from
Jul 26, 2018
Merged

add serializer file #777

merged 5 commits into from
Jul 26, 2018

Conversation

kentcdodds
Copy link
Contributor

@kentcdodds kentcdodds commented Jul 26, 2018

What: This adds a root-level serializer.js file

Why: It will make it much easier to use this package for the common use-case. People will be able to configure the serializer using the snapshotSerializers config:

{
  "snapshotSerializers": [
    "jest-emotion/serializer"
  ]
}

How: Created a new file called serializer.js in the root of the project that simply creates the serializer as documented.

Checklist:

  • Documentation
  • Tests N/A
  • Code complete

@@ -0,0 +1,4 @@
const { createSerializer } = require('./dist')
Copy link
Member

Choose a reason for hiding this comment

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

Could you change this to requiring jest-emotion instead of ./dist?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting! Will that work!?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, node should look in the node_modules folder, go into the jest-emotion folder and look at the main property in the package.json.

Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

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

Thanks!!

@emmatown emmatown merged commit 9472b84 into emotion-js:master Jul 26, 2018
@tkh44
Copy link
Member

tkh44 commented Jul 26, 2018

Thanks @kentcdodds

@kentcdodds kentcdodds deleted the patch-2 branch July 26, 2018 05:36
@ndelangen
Copy link
Contributor

Awesome! just what I needed!

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.

None yet

4 participants