Harden API test Docker setup and stabilize coverage fixtures
This commit is contained in:
1 parent
2a5ef9d9e8
commit
a3a7d4914b
7 files changed
+130
-11
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { existsSync, readFileSync } from 'node:fs';
|
||||
import { OPENAPI_FILE } from '../paths';
|
||||
|
||||
/**
|
||||
@@ -26,6 +26,13 @@ export function loadOperations(): ApiOperation[] {
|
||||
return cached;
|
||||
}
|
||||
|
||||
if (!existsSync(OPENAPI_FILE)) {
|
||||
throw new Error(
|
||||
`Coverage oracle ${OPENAPI_FILE} is missing. It is written by tests/api/global-setup.ts; ` +
|
||||
'run the suite through `pnpm test:api` or `pnpm test:api:run` rather than importing specs directly.',
|
||||
);
|
||||
}
|
||||
|
||||
const document = JSON.parse(readFileSync(OPENAPI_FILE, 'utf8'));
|
||||
const operations: ApiOperation[] = [];
|
||||
|
||||
|
||||
Reference in new issue
Block a user