Root build scripts, the desktop bundle and the dev:web watcher pass the native loader so tsdown never selects the undeclared unrun fallback. A spec covers the build.ts rejection path.
19 lines
756 B
TypeScript
19 lines
756 B
TypeScript
import { spawnSync } from 'node:child_process'
|
|
import { resolve } from 'node:path'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
const root = resolve(import.meta.dirname, '..')
|
|
|
|
describe('repository build CLI', () => {
|
|
// The sentinel makes parseArgs fail fast if the check ever stops running first.
|
|
it('rejects a Node process without TypeScript type stripping before any build step', () => {
|
|
const result = spawnSync(
|
|
process.execPath,
|
|
['--no-experimental-strip-types', '--import', 'tsx/esm', resolve(root, 'scripts/build.ts'), '--spec-sentinel'],
|
|
{ cwd: root, encoding: 'utf8' },
|
|
)
|
|
expect(result.status).not.toBe(0)
|
|
expect(result.stderr).toContain('build: Node.js TypeScript type stripping is unavailable')
|
|
})
|
|
})
|