File size: 1,096 Bytes
1477a90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { defineConfig } from 'vitest/config'

// The boundary mapper (src/lib/wire.ts) and the pagination iterators
// (src/lib/paginate.ts) are the hand-written runtime modules with no
// compile-time guard, so their behavior is covered entirely by tests. Hold
// them at full statement/line/function coverage. The branch threshold is
// below 100 because wire.ts's residual uncovered branches are defensive
// nullish-coalescing arms (`?? []`, `?? {}`) guarding zod internals that the
// preceding type-guard already makes non-null — unreachable with any real
// schema, so not worth contriving inputs for. paginate.ts itself has no such
// residual: tests/paginate.spec.ts exercises every stop condition (empty
// page, short page, exact-total page, absent next cursor) and both
// PaginationLimitExceededError throws.
export default defineConfig({
  test: {
    coverage: {
      provider: 'v8',
      include: ['src/lib/wire.ts', 'src/lib/paginate.ts'],
      thresholds: {
        statements: 100,
        functions: 100,
        lines: 100,
        branches: 85,
      },
    },
  },
})