Skip to content

Commit

Permalink
Merge pull request #3435 from jspsych/per-test-dom-reset
Browse files Browse the repository at this point in the history
force dom to clear after each individual test case
  • Loading branch information
jodeleeuw authored Nov 30, 2024
2 parents b0c6736 + 3de5aad commit 6c4c5ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-rivers-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@jspsych/config": minor
---

update to force the dom to clear after each individual test
1 change: 1 addition & 0 deletions packages/config/jest.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ module.exports.makePackageConfig = (dirname) => {
name: packageBaseName,
color: packageBaseName === "jspsych" ? "white" : "cyanBright",
},
setupFilesAfterEnv: ["../config/jest.setup.js"],
};
};
3 changes: 3 additions & 0 deletions packages/config/jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
global.afterEach(() => {
document.body.innerHTML = '';
});

0 comments on commit 6c4c5ba

Please sign in to comment.