Download scripts/test.mjs from xlt99/EmboDi: direct link, hf CLI and curl.
- Browser
- Download file 634 Bytes
-
https://huggingface.co/spaces/xlt99/EmboDi/resolve/main/scripts/test.mjs
- Command line
-
hf download hf://spaces/xlt99/EmboDi/scripts/test.mjs
-
curl -L -o test.mjs https://huggingface.co/spaces/xlt99/EmboDi/resolve/main/scripts/test.mjs
634 Bytes
| import {readdir} from 'node:fs/promises'; | |
| import {spawnSync} from 'node:child_process'; | |
| import {fileURLToPath} from 'node:url'; | |
| import {join} from 'node:path'; | |
| const root = fileURLToPath(new URL('../', import.meta.url)); | |
| const files = (await readdir(join(root, 'tests'))) | |
| .filter(name => name.endsWith('.test.mjs')) | |
| .sort().map(name => join(root, 'tests', name)); | |
| for (const args of [['--test', ...files], [join(root, 'tests/smoke.mjs')]]) { | |
| const result = spawnSync(process.execPath, args, {cwd: root, stdio: 'inherit'}); | |
| if (result.error) throw result.error; | |
| if (result.status !== 0) process.exit(result.status || 1); | |
| } | |