Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/sample-snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
54 changes: 24 additions & 30 deletions yarn.config.cjs

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test scripts requirements have been aligned so that snap and non-snap packages need to follow the same constraints

Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading