Skip to content

Commit

Permalink
remove styled-components matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
MicheleBertoli committed Jul 9, 2017
1 parent 031b460 commit 10fa37b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 67 deletions.
7 changes: 0 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"babel-jest": "^20.0.3",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"chalk": "^1.1.3",
"enzyme": "^2.8.2",
"enzyme-to-json": "^1.5.1",
"eslint": "^3.17.1",
Expand All @@ -29,15 +28,11 @@
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.10.0",
"jest": "^20.0.4",
"jest-diff": "^20.0.3",
"jest-matcher-utils": "^20.0.3",
"jest-snapshot": "^20.0.3",
"pretty-format": "^20.0.3",
"react": "^15.6.1",
"react-addons-test-utils": "^15.6.0",
"react-dom": "^15.6.1",
"react-test-renderer": "^15.6.1",
"strip-ansi": "^3.0.1",
"styled-components": "^2.1.0"
},
"dependencies": {
Expand All @@ -47,8 +42,6 @@
"chalk": "^1.1.3",
"jest-diff": "^20.0.3",
"jest-matcher-utils": "^20.0.3",
"jest-snapshot": "^20.0.3",
"strip-ansi": "^3.0.1",
"styled-components": "^2.0.0"
},
"jest": {
Expand Down
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const toMatchStyledComponentsSnapshot = require('./matchers/toMatchStyledComponentsSnapshot')
const toHaveStyleRule = require('./matchers/toHaveStyleRule')
const styleSheetSerializer = require('./serializers/styleSheetSerializer')
const styleSheet = require('styled-components/lib/models/StyleSheet')
Expand All @@ -9,4 +8,4 @@ if (isOverV2()) {
}

expect.addSnapshotSerializer(styleSheetSerializer)
expect.extend({ toMatchStyledComponentsSnapshot, toHaveStyleRule })
expect.extend({ toHaveStyleRule })
49 changes: 0 additions & 49 deletions src/matchers/toMatchStyledComponentsSnapshot.js

This file was deleted.

8 changes: 4 additions & 4 deletions test/__snapshots__/index.spec.js.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`toMatchStyledComponentsSnapshot mount 1`] = `
exports[`toMatchSnapshot mount 1`] = `
.c0 {
padding: 4em;
background: papayawhip;
Expand Down Expand Up @@ -49,9 +49,9 @@ exports[`toMatchStyledComponentsSnapshot mount 1`] = `
</styled.section>
`;

exports[`toMatchStyledComponentsSnapshot null 1`] = `null`;
exports[`toMatchSnapshot null 1`] = `null`;

exports[`toMatchStyledComponentsSnapshot shallow 1`] = `
exports[`toMatchSnapshot shallow 1`] = `
.c0 {
padding: 4em;
background: papayawhip;
Expand All @@ -66,7 +66,7 @@ exports[`toMatchStyledComponentsSnapshot shallow 1`] = `
</section>
`;

exports[`toMatchStyledComponentsSnapshot test-renderer 1`] = `
exports[`toMatchSnapshot test-renderer 1`] = `
.c0 {
padding: 4em;
background: papayawhip;
Expand Down
10 changes: 5 additions & 5 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const Title = styled.h1`
}
`

describe('toMatchStyledComponentsSnapshot', () => {
describe('toMatchSnapshot', () => {
test('null', () => {
expect(null).toMatchStyledComponentsSnapshot()
expect(null).toMatchSnapshot()
})

test('test-renderer', () => {
Expand All @@ -43,7 +43,7 @@ describe('toMatchStyledComponentsSnapshot', () => {
</Wrapper>
).toJSON()

expect(tree).toMatchStyledComponentsSnapshot()
expect(tree).toMatchSnapshot()
})

test('shallow', () => {
Expand All @@ -53,7 +53,7 @@ describe('toMatchStyledComponentsSnapshot', () => {
</Wrapper>
)

expect(tree).toMatchStyledComponentsSnapshot()
expect(tree).toMatchSnapshot()
})

test('mount', () => {
Expand All @@ -63,7 +63,7 @@ describe('toMatchStyledComponentsSnapshot', () => {
</Wrapper>
)

expect(tree).toMatchStyledComponentsSnapshot()
expect(tree).toMatchSnapshot()
})
})

Expand Down

0 comments on commit 10fa37b

Please sign in to comment.