diff --git a/examples/with-jest-react-testing-library/__tests__/__snapshots__/index.test.js.snap b/examples/with-jest-react-testing-library/__tests__/__snapshots__/index.test.js.snap new file mode 100644 index 00000000..e804d4bc --- /dev/null +++ b/examples/with-jest-react-testing-library/__tests__/__snapshots__/index.test.js.snap @@ -0,0 +1,11 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`With React Testing Library Snapshot Should match Snapshot 1`] = ` + +
+

+ Hello World! +

+
+
+`; diff --git a/examples/with-jest-react-testing-library/__tests__/index.test.js b/examples/with-jest-react-testing-library/__tests__/index.test.js index ecff441e..0ee749c7 100644 --- a/examples/with-jest-react-testing-library/__tests__/index.test.js +++ b/examples/with-jest-react-testing-library/__tests__/index.test.js @@ -12,3 +12,11 @@ describe('With React Testing Library', () => { expect(getByText('Hello World!')).not.toBeNull() }) }) + +describe('With React Testing Library Snapshot', () => { + it('Should match Snapshot', () => { + const { asFragment } = render() + + expect(asFragment()).toMatchSnapshot() + }) +}) diff --git a/examples/with-jest-react-testing-library/package.json b/examples/with-jest-react-testing-library/package.json index e631f5bb..7f6bab4f 100644 --- a/examples/with-jest-react-testing-library/package.json +++ b/examples/with-jest-react-testing-library/package.json @@ -7,6 +7,9 @@ "react-dom": "latest" }, "devDependencies": { + "@babel/core": "^7.1.2", + "babel-core": "^7.0.0-bridge", + "babel-jest": "^23.6.0", "react-testing-library": "^5.4.2", "jest": "^23.6.0" },