Download apps/cli/tests/source-launch.compat.spec.ts from SaylorTwift/deepseek-harness: direct link, hf CLI and curl.
- Browser
- Download file 1.76 kB
-
https://huggingface.co/SaylorTwift/deepseek-harness/resolve/main/apps/cli/tests/source-launch.compat.spec.ts
- Command line
-
hf download hf://SaylorTwift/deepseek-harness/apps/cli/tests/source-launch.compat.spec.ts
-
curl -L -o source-launch.compat.spec.ts https://huggingface.co/SaylorTwift/deepseek-harness/resolve/main/apps/cli/tests/source-launch.compat.spec.ts
1.76 kB
| import { readFile } from 'node:fs/promises' | |
| import { fileURLToPath } from 'node:url' | |
| import { execa } from 'execa' | |
| import { describe, expect, it } from 'vitest' | |
| /** | |
| * Keyless smoke for SOURCE `dsh` execution: run `apps/cli/src/bin.ts` | |
| * with the exact production runtime vector (`node --import tsx/esm`, the | |
| * vector the root `dsh` script invokes directly) and assert the | |
| * required-config diagnostic. The Node compatibility matrix runs this | |
| * WHOLE file, so a Node release changing module hooks or TypeScript handling | |
| * breaks this gate instead of every developer's `pnpm dsh`; the built-bin | |
| * suite covers the published `lib/` entry, not this source chain. | |
| */ | |
| const repoRoot = fileURLToPath(new URL('../../../', import.meta.url)) | |
| const dshSourceBin = 'apps/cli/src/bin.ts' | |
| describe('dsh SOURCE launcher (node --import tsx/esm)', () => { | |
| it('launches the source CLI without building', async () => { | |
| const rootPackage = JSON.parse(await readFile(new URL('../../../package.json', import.meta.url), 'utf8')) as { | |
| readonly scripts?: Record<string, string> | |
| } | |
| expect(rootPackage.scripts?.dsh).toBe('node --import tsx/esm apps/cli/src/bin.ts') | |
| }) | |
| it('boots the source entry and requires a profile', async () => { | |
| const result = await execa(process.execPath, ['--import', 'tsx/esm', dshSourceBin], { | |
| cwd: repoRoot, | |
| input: '', | |
| timeout: 25_000, | |
| killSignal: 'SIGKILL', | |
| reject: false, | |
| }) | |
| if (result.timedOut) { | |
| throw new Error(`dsh source launch did not exit within 25s. stdout:\n${result.stdout}\nstderr:\n${result.stderr}`) | |
| } | |
| expect(result.exitCode).not.toBe(0) | |
| expect(result.stderr).toContain('--profile <name> is required') | |
| expect(result.stdout).toBe('') | |
| }, 30_000) | |
| }) | |