From 47aaa0b8393db4a794611597754976a9fd341cbe Mon Sep 17 00:00:00 2001 From: Samuel Plumppu <6125097+Greenheart@users.noreply.github.com> Date: Tue, 6 Jan 2026 07:17:17 +0100 Subject: [PATCH 1/2] Document reason for failed test case in Toast.test.tsx --- design-system/pkg/src/toast/test/Toast.test.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/design-system/pkg/src/toast/test/Toast.test.tsx b/design-system/pkg/src/toast/test/Toast.test.tsx index 9be81f289..d124a9438 100644 --- a/design-system/pkg/src/toast/test/Toast.test.tsx +++ b/design-system/pkg/src/toast/test/Toast.test.tsx @@ -318,6 +318,11 @@ describe('toast/Toast', () => { await user.click(button); fireAnimationEnd(toast); + + // TODO: This test fails when running `pnpm test-strict` which enables React Strict Mode + // and renders components twice. + // Why? Most likely because ToastToggle component is not pure. + // The double rendering seem to get its internal state out of sync. expect(queryByRole('alert')).toBeNull(); }); From 75741237bc71686e0d78e592f64861cd0f64fcc7 Mon Sep 17 00:00:00 2001 From: Samuel Plumppu <6125097+Greenheart@users.noreply.github.com> Date: Tue, 6 Jan 2026 07:18:11 +0100 Subject: [PATCH 2/2] Replace `cross-env` with built-in pnpm feature `shellEmulator` --- package.json | 3 +-- pnpm-lock.yaml | 12 ------------ pnpm-workspace.yaml | 3 +++ 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 84c807167..bb70f98b3 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "start:designsystem": "pnpm --filter=@keystar/docs start", "static": "pnpm run validate && pnpm run test", "test": "pnpm run test:unit", - "test-strict": "cross-env STRICT_MODE=1 pnpm run test", + "test-strict": "STRICT_MODE=1 pnpm run test", "test:coverage": "jest ---coverage", "test:unit": "NODE_OPTIONS=--experimental-vm-modules jest", "validate": "pnpm run '/check:*/'", @@ -60,7 +60,6 @@ "@typescript-eslint/eslint-plugin": "^5.29.0", "@typescript-eslint/parser": "^5.29.0", "babel-plugin-react-compiler": "^0.0.0-experimental-696af53-20240625", - "cross-env": "^7.0.3", "eslint": "^8.18.0", "eslint-config-next": "^12.1.6", "eslint-config-prettier": "^8.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d5bc44d14..5b5815c75 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -62,9 +62,6 @@ importers: babel-plugin-react-compiler: specifier: ^0.0.0-experimental-696af53-20240625 version: 0.0.0-experimental-938cd9a-20240601 - cross-env: - specifier: ^7.0.3 - version: 7.0.3 eslint: specifier: ^8.18.0 version: 8.48.0 @@ -7699,11 +7696,6 @@ packages: create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - cross-env@7.0.3: - resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} - engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} - hasBin: true - cross-spawn@5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} @@ -23200,10 +23192,6 @@ snapshots: create-require@1.1.1: {} - cross-env@7.0.3: - dependencies: - cross-spawn: 7.0.3 - cross-spawn@5.1.0: dependencies: lru-cache: 4.1.5 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 0c2151cc6..68535411b 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -8,3 +8,6 @@ packages: - 'keystatic' - 'packages/*' - 'templates/*' + +# Ensure environment variables defined via NPM scripts work consistently for all operating systems. +shellEmulator: true