summaryrefslogtreecommitdiff
path: root/scripts/cmd/test.js
diff options
context:
space:
mode:
authorGravatar Bjorn Lu <bjornlu.dev@gmail.com> 2024-08-20 18:25:04 +0800
committerGravatar GitHub <noreply@github.com> 2024-08-20 18:25:04 +0800
commit1fd84b6bbc42885d0a80ea65a87b4a7946320924 (patch)
tree6bf19520a56b9c7cecdf3a64f2f9e65d868bb8bd /scripts/cmd/test.js
parent88b6dca63b56ef12b92543384365f8f7f1cad85d (diff)
downloadastro-1fd84b6bbc42885d0a80ea65a87b4a7946320924.tar.gz
astro-1fd84b6bbc42885d0a80ea65a87b4a7946320924.tar.zst
astro-1fd84b6bbc42885d0a80ea65a87b4a7946320924.zip
Remove unused code in internal scripts (#11769)
Diffstat (limited to 'scripts/cmd/test.js')
-rw-r--r--scripts/cmd/test.js14
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;