Skip to content

Commit 7b7460a

Browse files
committed
chore: update all the things
Fun note that it looks like more recent versions of jsdom now support document.createRange
1 parent 0afcbea commit 7b7460a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@
3939
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com)",
4040
"license": "MIT",
4141
"dependencies": {
42-
"@babel/runtime": "^7.9.6",
43-
"@testing-library/dom": "^7.2.2",
42+
"@babel/runtime": "^7.10.2",
43+
"@testing-library/dom": "^7.8.0",
4444
"@types/testing-library__react": "^10.0.1"
4545
},
4646
"devDependencies": {
4747
"@reach/router": "^1.3.3",
48-
"@testing-library/jest-dom": "^5.5.0",
48+
"@testing-library/jest-dom": "^5.9.0",
4949
"dotenv-cli": "^3.1.0",
50-
"kcd-scripts": "^5.11.1",
50+
"kcd-scripts": "^6.2.0",
5151
"npm-run-all": "^4.1.5",
5252
"react": "^16.13.1",
5353
"react-dom": "^16.13.1",

src/pure.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,16 @@ function render(
7474
// folks can use all the same utilities we return in the first place that are bound to the container
7575
},
7676
asFragment: () => {
77-
/* istanbul ignore if (jsdom limitation) */
77+
/* istanbul ignore else (old jsdom limitation) */
7878
if (typeof document.createRange === 'function') {
7979
return document
8080
.createRange()
8181
.createContextualFragment(container.innerHTML)
82+
} else {
83+
const template = document.createElement('template')
84+
template.innerHTML = container.innerHTML
85+
return template.content
8286
}
83-
84-
const template = document.createElement('template')
85-
template.innerHTML = container.innerHTML
86-
return template.content
8787
},
8888
...getQueriesForElement(baseElement, queries),
8989
}

0 commit comments

Comments
 (0)