Jelajahi Sumber

test(windows): skip unsupported SDK test surfaces

imccyu 2 bulan lalu
induk
melakukan
b5fa2cb2b8
2 mengubah file dengan 18 tambahan dan 2 penghapusan
  1. 1 1
      packages/sdk/create-sdk/tests/create.snapshot.ts
  2. 17 1
      vitest.config.ts

+ 1 - 1
packages/sdk/create-sdk/tests/create.snapshot.ts

@@ -71,7 +71,7 @@ class RecordingPort implements PromptPort {
   }
 }
 
-describe('create-sdk terminal contract', () => {
+describe.skipIf(process.platform === 'win32')('create-sdk terminal contract', () => {
   it('renders package-manager-specific setup commands', () => {
     const model = packageManagerTemplateModel(createPackageManager('yarn', '4.0.0'))
     expect(CREATE_TEMPLATES.installQuestion.render(model)).toBe('Run yarn install and then build the project?\n')

+ 17 - 1
vitest.config.ts

@@ -1,6 +1,16 @@
 import tsconfigPaths from 'vite-tsconfig-paths'
 import { defineConfig } from 'vitest/config'
 
+const windowsUnsupportedPackages = process.platform === 'win32'
+  ? [
+      'packages/bash/*',
+      'packages/hooks/*',
+      'packages/sandbox/sandbox-local',
+      'packages/sdk/create-sdk',
+      'packages/sdk/helper',
+    ]
+  : []
+
 export default defineConfig({
   // Native path resolution reads each package's nearest tsconfig, but only the root defines
   // workspace paths. Keep this plugin pinned to the root map so unbuilt bare package imports resolve
@@ -8,6 +18,7 @@ export default defineConfig({
   plugins: [tsconfigPaths({ projects: ['./tsconfig.json'] })],
   test: {
     include: ['packages/*/*/tests/**/*.spec.ts', 'examples/*/tests/**/*.spec.ts', 'scripts/**/*.spec.ts'],
+    exclude: windowsUnsupportedPackages.map(path => `${path}/tests/**/*.spec.ts`),
     coverage: {
       provider: 'v8',
       // Coverage measures OUR runtime source. Types-only files carry no
@@ -16,7 +27,12 @@ export default defineConfig({
       include: ['packages/*/*/src/**/*.ts'],
       // Types-only files have no runtime coverage. Importing self-executing bins/workers would boot
       // them inside the unit process, so real subprocess/Worker tests cover their thin entry glue.
-      exclude: ['packages/*/*/src/types.ts', 'packages/*/*/src/bin.ts', 'packages/*/*/src/worker.ts'],
+      exclude: [
+        'packages/*/*/src/types.ts',
+        'packages/*/*/src/bin.ts',
+        'packages/*/*/src/worker.ts',
+        ...windowsUnsupportedPackages.map(path => `${path}/src/**/*.ts`),
+      ],
       // 100% or it doesn't merge (docs/testing.md: excessive tests are welcome).
       // Per-file so a well-covered big file can't subsidize a bare one.
       // Every v8 ignore comment must carry a reason — see the quality-gates RFC