From 4e1b5997d0afe7d3b7a253616d30aed1ea4550d7 Mon Sep 17 00:00:00 2001 From: mikesposito Date: Wed, 8 Jul 2026 14:35:22 +0200 Subject: [PATCH 1/2] fix: add test scripts to sample snap --- packages/sample-snap/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/sample-snap/package.json b/packages/sample-snap/package.json index 5a287383..c560e1db 100644 --- a/packages/sample-snap/package.json +++ b/packages/sample-snap/package.json @@ -40,7 +40,9 @@ "prepublishOnly": "mm-snap manifest", "serve": "mm-snap serve", "start": "mm-snap watch", - "test": "jest", + "test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache", + "test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose", + "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch", "since-latest-release": "../../scripts/since-latest-release.sh" }, "dependencies": { From 0ca9a60662034edf1b4fcd5322121acbfede87df Mon Sep 17 00:00:00 2001 From: mikesposito Date: Wed, 8 Jul 2026 14:46:04 +0200 Subject: [PATCH 2/2] update yarn constraints --- packages/sample-snap/package.json | 1 + yarn.config.cjs | 54 ++++++++++++++----------------- 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/packages/sample-snap/package.json b/packages/sample-snap/package.json index c560e1db..2a810e72 100644 --- a/packages/sample-snap/package.json +++ b/packages/sample-snap/package.json @@ -40,6 +40,7 @@ "prepublishOnly": "mm-snap manifest", "serve": "mm-snap serve", "start": "mm-snap watch", + "test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter", "test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache", "test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose", "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch", diff --git a/yarn.config.cjs b/yarn.config.cjs index cde2017a..86c52bc6 100644 --- a/yarn.config.cjs +++ b/yarn.config.cjs @@ -200,39 +200,33 @@ module.exports = defineConfig({ '../../scripts/since-latest-release.sh', ); - if (isSnap) { - // Snap packages need `jest` available but typically use - // `@metamask/snaps-jest`; the script wording is left to each snap. - expectWorkspaceField(workspace, 'scripts.test'); - } else { - // All non-root packages must have the same "test" script. - expectWorkspaceField( - workspace, - 'scripts.test', - 'NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter', - ); + // All non-root packages must have the same "test" script. + expectWorkspaceField( + workspace, + 'scripts.test', + 'NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter', + ); - // All non-root packages must have the same "test:clean" script. - expectWorkspaceField( - workspace, - 'scripts.test:clean', - 'NODE_OPTIONS=--experimental-vm-modules jest --clearCache', - ); + // All non-root packages must have the same "test:clean" script. + expectWorkspaceField( + workspace, + 'scripts.test:clean', + 'NODE_OPTIONS=--experimental-vm-modules jest --clearCache', + ); - // All non-root packages must have the same "test:verbose" script. - expectWorkspaceField( - workspace, - 'scripts.test:verbose', - 'NODE_OPTIONS=--experimental-vm-modules jest --verbose', - ); + // All non-root packages must have the same "test:verbose" script. + expectWorkspaceField( + workspace, + 'scripts.test:verbose', + 'NODE_OPTIONS=--experimental-vm-modules jest --verbose', + ); - // All non-root packages must have the same "test:watch" script. - expectWorkspaceField( - workspace, - 'scripts.test:watch', - 'NODE_OPTIONS=--experimental-vm-modules jest --watch', - ); - } + // All non-root packages must have the same "test:watch" script. + expectWorkspaceField( + workspace, + 'scripts.test:watch', + 'NODE_OPTIONS=--experimental-vm-modules jest --watch', + ); } if (isChildWorkspace) {