0.6.0 • Published 2 years ago
@machinat/jest-snapshot-serializer v0.6.0
Jest Snapshot Serializer
Format Machinat JSX elements in the jest snapshot.
Install
npm install @machinat/jest-snapshot-serializer
# or with yarn
yarn add @machinat/jest-snapshot-serializer
Setup
Add the serializer to into jest.config.js
:
module.exports = {
// ...
snapshotSerializers: ['@machinat/jest-snapshot-serializer'],
};
Or packages.json
:
{
"name": "my-project",
"jest": {
"snapshotSerializers": ["@machinat/jest-snapshot-serializer"],
}
}
Example
expect(
<GenericTemplate imageAspectRatio="square" sharable>
<GenericItem
title="foo"
imageUrl="http://foo.bar/image"
buttons={<UrlButton title="check" url="http://xxx.yy.z" />}
/>
</GenericTemplate>
).toMatchInlineSnapshot(`
<GenericTemplate
imageAspectRatio="square"
sharable={true}
>
<GenericItem
buttons={
<UrlButton
title="check"
url="http://xxx.yy.z"
/>
}
imageUrl="http://foo.bar/image"
title="foo"
/>
</GenericTemplate>
`);
0.6.0
2 years ago
0.6.0-canary.1
2 years ago
0.6.0-beta.0
2 years ago
0.5.0-beta.25
2 years ago
0.5.0-beta.14
2 years ago
0.5.0
2 years ago
0.5.0-beta.1
3 years ago
0.5.0-beta.0
3 years ago
0.4.1-alpha.44
3 years ago
0.4.1-alpha.34
3 years ago
0.4.1-alpha.33
3 years ago
0.4.1-alpha.29
3 years ago
0.4.1-alpha.28
3 years ago
0.4.1-alpha.3
3 years ago
0.4.1-alpha.1
3 years ago
0.4.0-beta.1
3 years ago
0.3.0-beta.2
4 years ago
0.3.0-beta.1
4 years ago
0.3.0-beta.0
4 years ago