From e553dae609ccb6d9f6b5bc47ca6f4723e3434e13 Mon Sep 17 00:00:00 2001 From: Arumugam G Date: Thu, 7 May 2026 17:02:04 +0000 Subject: [PATCH] fix(test): align test:match and test:cli script globs with .test.ts files After #16402 migrated every test under packages/astro/test to TypeScript, two scripts in packages/astro/package.json were left pointing at non-existent .test.js globs: "test:match": "astro-scripts test \"test/**/*.test.js\" --match", "test:cli": "astro-scripts test \"test/**/cli.test.js\"", Because astro-scripts wraps the matched files in a temp module before invoking node:test, an empty match still produces a passing run (one phantom "1 test" from the empty wrapper), so the breakage was silent. This commit: - updates the globs to .test.ts so they match real files (test/cli.test.ts, test/units/**/*.test.ts, test/*.test.ts); - adds --strip-types so node:test can load the TypeScript files, matching the existing test:unit and test:integration scripts; - restores test:match as the documented "run a subset of tests by name pattern" command referenced in CONTRIBUTING.md. Verified locally: "pnpm test:cli --match 'astro --version'" now runs the real "astro cli > astro --version" test from test/cli.test.ts, where previously it reported a phantom "1 test passed" without executing any cli.test code. --- packages/astro/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/astro/package.json b/packages/astro/package.json index 06ad6f8b6b01..0299e5f35db0 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -122,8 +122,8 @@ "build:ci": "pnpm run prebuild && astro-scripts build \"src/**/*.{ts,js}\" --copy-wasm", "dev": "astro-scripts dev --copy-wasm --prebuild \"src/runtime/server/astro-island.ts\" --prebuild \"src/runtime/client/{idle,load,media,only,visible}.ts\" \"src/**/*.{ts,js}\"", "test": "pnpm run test:unit && pnpm run test:integration && pnpm run test:types", - "test:match": "astro-scripts test \"test/**/*.test.js\" --match", - "test:cli": "astro-scripts test \"test/**/cli.test.js\"", + "test:match": "astro-scripts test \"test/**/*.test.ts\" --match --strip-types", + "test:cli": "astro-scripts test \"test/**/cli.test.ts\" --strip-types", "test:e2e": "pnpm test:e2e:chrome && pnpm test:e2e:firefox", "test:e2e:match": "playwright test -g", "test:e2e:chrome": "playwright test",