diff options
author | 2024-08-20 14:29:50 +0200 | |
---|---|---|
committer | 2024-08-20 14:29:50 +0200 | |
commit | 787fed8504e7ec604d96ff266f58db715e84f736 (patch) | |
tree | ef29a659ddf6511e2564ee4d442f992cc9695241 /scripts/cmd/test.js | |
parent | 6617491c3bc2bde87f7867d7dec2580781852cfc (diff) | |
parent | c6622adaeb405e961b12c91f0e5d02c7333d01cf (diff) | |
download | astro-787fed8504e7ec604d96ff266f58db715e84f736.tar.gz astro-787fed8504e7ec604d96ff266f58db715e84f736.tar.zst astro-787fed8504e7ec604d96ff266f58db715e84f736.zip |
Merge branch 'main' into next
Diffstat (limited to 'scripts/cmd/test.js')
-rw-r--r-- | scripts/cmd/test.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/cmd/test.js b/scripts/cmd/test.js index 17f6ecd04..3182c4b90 100644 --- a/scripts/cmd/test.js +++ b/scripts/cmd/test.js @@ -1,10 +1,10 @@ -import { run } from 'node:test'; -import { spec } from 'node:test/reporters'; import fs from 'node:fs/promises'; import path from 'node:path'; +import { run } from 'node:test'; +import { spec } from 'node:test/reporters'; import { pathToFileURL } from 'node:url'; import { parseArgs } from 'node:util'; -import glob from 'tiny-glob'; +import glob from 'fast-glob'; const isCI = !!process.env.CI; const defaultTimeout = isCI ? 1400000 : 600000; @@ -31,7 +31,11 @@ export default async function test() { const pattern = args.positionals[1]; if (!pattern) throw new Error('Missing test glob pattern'); - const files = await glob(pattern, { filesOnly: true, absolute: true }); + const files = await glob(pattern, { + filesOnly: true, + absolute: true, + ignore: ['**/node_modules/**'], + }); // For some reason, the `only` option does not work and we need to explicitly set the CLI flag instead. // Node.js requires opt-in to run .only tests :( @@ -48,7 +52,7 @@ export default async function test() { await fs.mkdir(path.dirname(tempTestFile), { recursive: true }); await fs.writeFile( tempTestFile, - files.map((f) => `import ${JSON.stringify(pathToFileURL(f).toString())};`).join('\n') + files.map((f) => `import ${JSON.stringify(pathToFileURL(f).toString())};`).join('\n'), ); files.length = 0; |