From f775e9caa5bff4fa26d92afcc202e621bab0466e Mon Sep 17 00:00:00 2001 From: Christian Murphy Date: Wed, 9 Dec 2020 13:48:44 -0700 Subject: [PATCH] test: drop enzyme as dependency --- package.json | 2 -- test/__snapshots__/react-markdown.test.js.snap | 10 ++++++++++ test/react-markdown.test.js | 9 ++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index d206c045..c66ab71d 100644 --- a/package.json +++ b/package.json @@ -66,8 +66,6 @@ "@types/react-dom": "^16.0.0", "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "dtslint": "^4.0.0", - "enzyme": "^3.10.0", - "enzyme-adapter-react-16": "^1.0.0", "eslint": "^7.0.0", "eslint-config-prettier": "^6.0.0", "eslint-config-sanity": "^4.0.0", diff --git a/test/__snapshots__/react-markdown.test.js.snap b/test/__snapshots__/react-markdown.test.js.snap index a29e2e63..33b58e9a 100644 --- a/test/__snapshots__/react-markdown.test.js.snap +++ b/test/__snapshots__/react-markdown.test.js.snap @@ -1389,6 +1389,16 @@ exports[`should be able to render inline html with self-closing tags properly wi

`; +exports[`should be able to render inline html with self-closing tags with attributes properly with HTML parser plugin (#2) 1`] = ` +

+ I am having + + so much fun +

+`; + exports[`should be able to render inline html with self-closing tags with attributes properly with HTML parser plugin 1`] = `

I am having diff --git a/test/react-markdown.test.js b/test/react-markdown.test.js index 1a211a5a..d877746f 100644 --- a/test/react-markdown.test.js +++ b/test/react-markdown.test.js @@ -1,7 +1,5 @@ /* eslint-env jest */ /* eslint-disable react/prop-types */ -const Enzyme = require('enzyme') -const Adapter = require('enzyme-adapter-react-16') const fs = require('fs') const path = require('path') const React = require('react') @@ -16,8 +14,6 @@ const Markdown = require('../src/react-markdown') const MarkdownWithHtml = require('../src/with-html') const toc = require('remark-toc') -Enzyme.configure({adapter: new Adapter()}) - const renderHTML = (input) => ReactDom.renderToStaticMarkup(input).replace(/^

|<\/div>$/g, '') test('can render the most basic of documents (single paragraph)', () => { @@ -314,7 +310,10 @@ test('should be able to render inline html with self-closing tags with attribute test('should be able to render inline html with self-closing tags with attributes properly with HTML parser plugin (#2)', () => { const input = 'I am having so much fun' - Enzyme.mount() + const component = renderer.create( + + ) + expect(component.toJSON()).toMatchSnapshot() }) test('should be able to render multiple inline html elements with self-closing tags with attributes properly with HTML parser plugin', () => {