diff --git a/packages/sample-snap/package.json b/packages/sample-snap/package.json index 5a287383..2a810e72 100644 --- a/packages/sample-snap/package.json +++ b/packages/sample-snap/package.json @@ -40,7 +40,10 @@ "prepublishOnly": "mm-snap manifest", "serve": "mm-snap serve", "start": "mm-snap watch", - "test": "jest", + "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", "since-latest-release": "../../scripts/since-latest-release.sh" }, "dependencies": { 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) {