Skip to content

Commit a5a431f

Browse files
committed
Fix base element reset
1 parent d9e491a commit a5a431f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: test/config/jest.setup-tests.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ beforeAll(async () => {
3232
fn(type, listener, options);
3333
}
3434

35-
// Add to default key arry to prevent removal during reset
35+
// Add to default key array to prevent removal during reset
3636
sideEffects[obj].keys.push('addEventListener');
3737

3838
// Replace addEventListener with mock
@@ -41,16 +41,16 @@ beforeAll(async () => {
4141
});
4242

4343
// Reset JSDOM. This attempts to remove side effects from tests, however it does
44-
// not reset all changes made to globals like the the window and document
44+
// not reset all changes made to globals like the window and document
4545
// objects. Tests requiring a full JSDOM reset should be stored in separate
46-
// files, which is only way to do a complete reset of JSDOM with Jest.
46+
// files, which is only way to do a complete JSDOM reset with Jest.
4747
beforeEach(async () => {
4848
const rootElm = document.documentElement;
4949

5050
// Remove attributes on root element
5151
[...rootElm.attributes].forEach(attr => rootElm.removeAttribute(attr.name));
5252

53-
// Remove elements (faster the setting innerHTML)
53+
// Remove elements (faster than setting innerHTML)
5454
while (rootElm.firstChild) {
5555
rootElm.removeChild(rootElm.firstChild);
5656
}
@@ -74,7 +74,7 @@ beforeEach(async () => {
7474
});
7575

7676
// Restore base elements
77-
rootElm.innerHTML = '<html><head></head><body></body></html>';
77+
rootElm.innerHTML = '<head></head><body></body>';
7878
});
7979

8080
afterEach(async () => {

0 commit comments

Comments
 (0)