also looking at this
test: raise instead of skipping when a provided live service is missing
#1187
4 files
+194
-9
| @@ -5,16 +5,23 @@ | ||
| 5 | 5 | * BUNDLED output — a source-level test can never catch a bundler binding-split. |
| 6 | 6 | * config is now stored on a globalThis Symbol so every inlined copy shares it; |
| 7 | 7 | * this guard imports the built dist in a fresh process and asserts setConfig |
| 8 | * reaches the model layer. Skipped when dist/ hasn't been built. | |
| 8 | * reaches the model layer. | |
| 9 | * | |
| 10 | * Skipped when dist/ hasn't been built — locally. The CI `test` job builds | |
| 11 | * before it tests, so there a missing dist means the build step did not run, | |
| 12 | * and the one guard that can see a bundler binding-split would skip on exactly | |
| 13 | * the run that needed it. See `gate.ts`. | |
| 9 | 14 | */ |
| 10 | 15 | |
| 11 | 16 | import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' |
| 12 | 17 | import { tmpdir } from 'node:os' |
| 13 | 18 | import { join, resolve } from 'node:path' |
| 14 | 19 | import { describe, expect, it } from 'bun:test' |
| 20 | import { gateUnavailable } from './gate' | |
| 15 | 21 | |
| 16 | 22 | const DIST = resolve(import.meta.dir, '../dist/src/index.js') |
| 17 | 23 | const distBuilt = existsSync(DIST) |
| 24 | || gateUnavailable('the bundled dist', `${DIST} does not exist`, 'Run `bun run build`.') | |
| 18 | 25 | |
| 19 | 26 | describe.skipIf(!distBuilt)('config singleton survives bundling (#1043)', () => { |
| 20 | 27 | it('setConfig reaches the model layer in the built dist', () => { |