From 50119a6f5c1713f4e5971415c2135759c754d5d2 Mon Sep 17 00:00:00 2001 From: jade <101148768+jadeddelta@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:46:26 -0500 Subject: [PATCH 1/2] force dom to clear after each individual test case --- packages/config/jest.cjs | 1 + packages/config/jest.setup.js | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 packages/config/jest.setup.js diff --git a/packages/config/jest.cjs b/packages/config/jest.cjs index a905f0c42b..43ea363093 100644 --- a/packages/config/jest.cjs +++ b/packages/config/jest.cjs @@ -19,5 +19,6 @@ module.exports.makePackageConfig = (dirname) => { name: packageBaseName, color: packageBaseName === "jspsych" ? "white" : "cyanBright", }, + setupFilesAfterEnv: ["../config/jest.setup.js"], }; }; diff --git a/packages/config/jest.setup.js b/packages/config/jest.setup.js new file mode 100644 index 0000000000..4c6b91b318 --- /dev/null +++ b/packages/config/jest.setup.js @@ -0,0 +1,3 @@ +global.afterEach(() => { + document.body.innerHTML = ''; +}); \ No newline at end of file From 3de5aad43b538be56a3957be5beb6e9910b74267 Mon Sep 17 00:00:00 2001 From: jade <101148768+jadeddelta@users.noreply.github.com> Date: Wed, 13 Nov 2024 11:16:39 -0500 Subject: [PATCH 2/2] add changeset --- .changeset/swift-rivers-deliver.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/swift-rivers-deliver.md diff --git a/.changeset/swift-rivers-deliver.md b/.changeset/swift-rivers-deliver.md new file mode 100644 index 0000000000..3c19d6be5c --- /dev/null +++ b/.changeset/swift-rivers-deliver.md @@ -0,0 +1,5 @@ +--- +"@jspsych/config": minor +--- + +update to force the dom to clear after each individual test