diff --git a/test/config/jest.setup-tests.js b/test/config/jest.setup-tests.js index e18d24bd..94673e5e 100644 --- a/test/config/jest.setup-tests.js +++ b/test/config/jest.setup-tests.js @@ -32,7 +32,7 @@ beforeAll(async () => { fn(type, listener, options); } - // Add to default key arry to prevent removal during reset + // Add to default key array to prevent removal during reset sideEffects[obj].keys.push('addEventListener'); // Replace addEventListener with mock @@ -41,16 +41,16 @@ beforeAll(async () => { }); // Reset JSDOM. This attempts to remove side effects from tests, however it does -// not reset all changes made to globals like the the window and document +// not reset all changes made to globals like the window and document // objects. Tests requiring a full JSDOM reset should be stored in separate -// files, which is only way to do a complete reset of JSDOM with Jest. +// files, which is only way to do a complete JSDOM reset with Jest. beforeEach(async () => { const rootElm = document.documentElement; // Remove attributes on root element [...rootElm.attributes].forEach(attr => rootElm.removeAttribute(attr.name)); - // Remove elements (faster the setting innerHTML) + // Remove elements (faster than setting innerHTML) while (rootElm.firstChild) { rootElm.removeChild(rootElm.firstChild); } @@ -74,7 +74,7 @@ beforeEach(async () => { }); // Restore base elements - rootElm.innerHTML = ''; + rootElm.innerHTML = ''; }); afterEach(async () => {