Skip to content

Instantly share code, notes, and snippets.

@mrmartineau
Last active July 1, 2018 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrmartineau/fe307f001bfe88743b6dc95c82ba58e0 to your computer and use it in GitHub Desktop.
Save mrmartineau/fe307f001bfe88743b6dc95c82ba58e0 to your computer and use it in GitHub Desktop.
jest/styled-components snapshot bug...
{
"presets": [
[
"env",
{
"modules": false
}
],
"react"
],
"plugins": [
"transform-object-rest-spread",
[
"babel-plugin-styled-components",
{
"displayName": true
}
]
],
"env": {
"test": {
"presets": [
[
"env",
{
"modules": "commonjs",
"debug": false
}
],
"react",
"jest"
]
},
"production": {
"plugins": [
"transform-object-rest-spread",
[
"babel-plugin-styled-components",
{
"displayName": false
}
]
],
}
}
}
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Link snapshot 1`] = `
Object {
"baseElement": <html>
<head>
<style
data-styled-components=""
>
/* sc-component-id: sc-bdVaJa */
.sc-bdVaJa {} .dOvzuO{-webkit-text-decoration:none;text-decoration:none;color:#007C98;-webkit-transition:all 300ms cubic-bezier(0.77,0,0.175,1);transition:all 300ms cubic-bezier(0.77,0,0.175,1);} .dOvzuO:hover,.dOvzuO:focus{-webkit-text-decoration:underline;text-decoration:underline;color:#005E73;}
</style>
</head>
<body>
<div>
<a
class="sc-bdVaJa dOvzuO"
href="https://google.com"
>
This is a link
</a>
</div>
</body>
</html>,
"container": <div>
<a
class="sc-bdVaJa dOvzuO"
href="https://fairfx.com"
>
This is a link
</a>
</div>,
"debug": [Function],
"getAllByAltText": [Function],
"getAllByLabelText": [Function],
"getAllByPlaceholderText": [Function],
"getAllByTestId": [Function],
"getAllByText": [Function],
"getAllByTitle": [Function],
"getAllByValue": [Function],
"getByAltText": [Function],
"getByLabelText": [Function],
"getByPlaceholderText": [Function],
"getByTestId": [Function],
"getByText": [Function],
"getByTitle": [Function],
"getByValue": [Function],
"queryAllByAltText": [Function],
"queryAllByLabelText": [Function],
"queryAllByPlaceholderText": [Function],
"queryAllByTestId": [Function],
"queryAllByText": [Function],
"queryAllByTitle": [Function],
"queryAllByValue": [Function],
"queryByAltText": [Function],
"queryByLabelText": [Function],
"queryByPlaceholderText": [Function],
"queryByTestId": [Function],
"queryByText": [Function],
"queryByTitle": [Function],
"queryByValue": [Function],
"rerender": [Function],
"unmount": [Function],
}
`;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Link snapshot 1`] = `
Object {
"container": <div>
<a
class="sc-bdVaJa dOvzuO"
href="https://google.com"
>
This is a link
</a>
</div>,
"debug": [Function],
"getAllByAltText": [Function],
"getAllByLabelText": [Function],
"getAllByPlaceholderText": [Function],
"getAllByTestId": [Function],
"getAllByText": [Function],
"getAllByTitle": [Function],
"getAllByValue": [Function],
"getByAltText": [Function],
"getByLabelText": [Function],
"getByPlaceholderText": [Function],
"getByTestId": [Function],
"getByText": [Function],
"getByTitle": [Function],
"getByValue": [Function],
"queryAllByAltText": [Function],
"queryAllByLabelText": [Function],
"queryAllByPlaceholderText": [Function],
"queryAllByTestId": [Function],
"queryAllByText": [Function],
"queryAllByTitle": [Function],
"queryAllByValue": [Function],
"queryByAltText": [Function],
"queryByLabelText": [Function],
"queryByPlaceholderText": [Function],
"queryByTestId": [Function],
"queryByText": [Function],
"queryByTitle": [Function],
"queryByValue": [Function],
"rerender": [Function],
"unmount": [Function],
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment