From e7afc944f1dc8f343f3fe371a0d5405b4e3636af Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 27 Aug 2017 22:24:37 -0700 Subject: [PATCH] [Deps] [breaking] update `cheerio` to v1 See https://github.com/cheeriojs/cheerio/issues/1047#issuecomment-325221409 --- packages/enzyme/package.json | 2 +- packages/enzyme/src/ReactWrapper.js | 2 +- packages/enzyme/src/ShallowWrapper.js | 2 +- packages/enzyme/src/render.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/enzyme/package.json b/packages/enzyme/package.json index f6a5cba88..7f7b444b3 100644 --- a/packages/enzyme/package.json +++ b/packages/enzyme/package.json @@ -31,7 +31,7 @@ "author": "Leland Richardson ", "license": "MIT", "dependencies": { - "cheerio": "^0.22.0", + "cheerio": "^1.0.0-rc.2", "function.prototype.name": "^1.0.3", "is-subset": "^0.1.1", "lodash": "^4.17.4", diff --git a/packages/enzyme/src/ReactWrapper.js b/packages/enzyme/src/ReactWrapper.js index e0eabf7c3..9ed8daaa0 100644 --- a/packages/enzyme/src/ReactWrapper.js +++ b/packages/enzyme/src/ReactWrapper.js @@ -564,7 +564,7 @@ class ReactWrapper { */ render() { const html = this.html(); - return html === null ? cheerio() : cheerio.load(html).root(); + return html === null ? cheerio() : cheerio.load('')(html).root(); } /** diff --git a/packages/enzyme/src/ShallowWrapper.js b/packages/enzyme/src/ShallowWrapper.js index 5bab2813e..fc9d1e244 100644 --- a/packages/enzyme/src/ShallowWrapper.js +++ b/packages/enzyme/src/ShallowWrapper.js @@ -639,7 +639,7 @@ class ShallowWrapper { * @returns {CheerioWrapper} */ render() { - return this.type() === null ? cheerio() : cheerio.load(this.html()).root(); + return this.type() === null ? cheerio() : cheerio.load('')(this.html()).root(); } /** diff --git a/packages/enzyme/src/render.js b/packages/enzyme/src/render.js index d24f4ebf0..12bc378ed 100644 --- a/packages/enzyme/src/render.js +++ b/packages/enzyme/src/render.js @@ -19,5 +19,5 @@ export default function render(node, options = {}) { const adapter = getAdapter(options); const renderer = adapter.createRenderer({ mode: 'string', ...options }); const html = renderer.render(node, options.context); - return cheerio.load(html).root(); + return cheerio.load('')(html).root(); }