-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
26 lines (24 loc) · 992 Bytes
/
Copy pathvitest.config.ts
File metadata and controls
26 lines (24 loc) · 992 Bytes
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
import { configDefaults, defineConfig } from 'vitest/config';
import { missingPdfs } from './src/test/pdfSources';
// Tests whose fixtures are extracted from the local source PDFs (copyrighted,
// never committed — see src/test/pdfSources.ts). When any PDF is missing
// (e.g. CI), these are excluded and only the self-contained tests run.
const FIXTURE_TESTS = [
'src/lib/engine/convert.test.ts',
'src/lib/engine/normalize.test.ts',
'src/lib/engine/sourceParser.test.ts',
'src/lib/engine/spellParser.test.ts',
'src/lib/engine/supplementary.test.ts',
'src/lib/engine/tableParser.test.ts',
'src/lib/modules/pipeline.test.ts',
];
export default defineConfig({
test: {
environment: 'node',
include: ['src/**/*.test.ts'],
exclude: [...configDefaults.exclude, ...(missingPdfs().length ? FIXTURE_TESTS : [])],
globalSetup: ['src/test/globalSetup.ts'],
// PDF extraction in globalSetup can take a few seconds on a cold cache.
testTimeout: 20000,
},
});