Skip to content

Commit

Permalink
chore: update all the things
Browse files Browse the repository at this point in the history
Fun note that it looks like more recent versions of jsdom now support
document.createRange
  • Loading branch information
kentcdodds committed Jun 1, 2020
1 parent 0afcbea commit 7b7460a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -39,15 +39,15 @@
"author": "Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.9.6",
"@testing-library/dom": "^7.2.2",
"@babel/runtime": "^7.10.2",
"@testing-library/dom": "^7.8.0",
"@types/testing-library__react": "^10.0.1"
},
"devDependencies": {
"@reach/router": "^1.3.3",
"@testing-library/jest-dom": "^5.5.0",
"@testing-library/jest-dom": "^5.9.0",
"dotenv-cli": "^3.1.0",
"kcd-scripts": "^5.11.1",
"kcd-scripts": "^6.2.0",
"npm-run-all": "^4.1.5",
"react": "^16.13.1",
"react-dom": "^16.13.1",
Expand Down
10 changes: 5 additions & 5 deletions src/pure.js
Expand Up @@ -74,16 +74,16 @@ function render(
// folks can use all the same utilities we return in the first place that are bound to the container
},
asFragment: () => {
/* istanbul ignore if (jsdom limitation) */
/* istanbul ignore else (old jsdom limitation) */
if (typeof document.createRange === 'function') {
return document
.createRange()
.createContextualFragment(container.innerHTML)
} else {
const template = document.createElement('template')
template.innerHTML = container.innerHTML
return template.content
}

const template = document.createElement('template')
template.innerHTML = container.innerHTML
return template.content
},
...getQueriesForElement(baseElement, queries),
}
Expand Down

0 comments on commit 7b7460a

Please sign in to comment.