Download scripts/run-tests.mjs from smlflg/archify-hai: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/smlflg/archify-hai/resolve/main/scripts/run-tests.mjs
- Command line
-
hf download hf://smlflg/archify-hai/scripts/run-tests.mjs
-
curl -L -o run-tests.mjs https://huggingface.co/smlflg/archify-hai/resolve/main/scripts/run-tests.mjs
1.06 kB
| import { spawnSync } from 'node:child_process'; | |
| import fs from 'node:fs'; | |
| import path from 'node:path'; | |
| import { fileURLToPath } from 'node:url'; | |
| const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); | |
| const skillRoot = path.join(repoRoot, 'archify'); | |
| const testRoot = path.join(skillRoot, 'test'); | |
| const testFiles = fs.readdirSync(testRoot) | |
| .filter((entry) => entry.endsWith('.test.mjs')) | |
| .sort() | |
| .map((entry) => path.join('test', entry)); | |
| const [major, minor] = process.versions.node.split('.').map(Number); | |
| const supportsConcurrencyFlag = major > 18 || (major === 18 && minor >= 19); | |
| const args = ['--test']; | |
| if (supportsConcurrencyFlag) args.push('--test-concurrency=2'); | |
| args.push(...testFiles); | |
| const result = spawnSync(process.execPath, args, { | |
| cwd: skillRoot, | |
| stdio: 'inherit', | |
| }); | |
| if (result.error) throw result.error; | |
| if (result.signal) { | |
| process.stderr.write(`test runner terminated by ${result.signal}\n`); | |
| process.exitCode = 1; | |
| } else { | |
| process.exitCode = result.status ?? 1; | |
| } | |