ReviewOS

also looking at this

stacks/bun-query-builder

test: raise instead of skipping when a provided live service is missing

#1187
Merged glennmichael123 wants to merge test/loud-service-gates into main
4 files +194 -9
packages/bun-query-builder/test/dist.config-singleton.test.tsmodified+8-1
Changes to packages/bun-query-builder/test/dist.config-singleton.test.ts
@@ -5,16 +5,23 @@
55 * BUNDLED output — a source-level test can never catch a bundler binding-split.
66 * config is now stored on a globalThis Symbol so every inlined copy shares it;
77 * 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`.
914 */
1015
1116import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
1217import { tmpdir } from 'node:os'
1318import { join, resolve } from 'node:path'
1419import { describe, expect, it } from 'bun:test'
20import { gateUnavailable } from './gate'
1521
1622const DIST = resolve(import.meta.dir, '../dist/src/index.js')
1723const distBuilt = existsSync(DIST)
24 || gateUnavailable('the bundled dist', `${DIST} does not exist`, 'Run `bun run build`.')
1825
1926describe.skipIf(!distBuilt)('config singleton survives bundling (#1043)', () => {
2027 it('setConfig reaches the model layer in the built dist', () => {