MCPcopy Create free account
hub / github.com/pmxt-dev/pmxt / withGeneratedSpec

Function withGeneratedSpec

core/test/unit/openapi-code-samples.test.js:84–97  ·  view source on GitHub ↗
(assertion)

Source from the content-addressed store, hash-verified

82}
83
84function withGeneratedSpec(assertion) {
85 const snapshot = snapshotGeneratedFiles();
86 try {
87 execFileSync(process.execPath, ['scripts/generate-openapi.js'], {
88 cwd: coreRoot,
89 stdio: 'pipe',
90 });
91
92 const spec = JSON.parse(fs.readFileSync(openApiPath, 'utf8'));
93 return assertion(spec);
94 } finally {
95 restoreGeneratedFiles(snapshot);
96 }
97}
98
99describe('OpenAPI SDK code samples', () => {
100 test('uses support-scoped hosted API description', () => {

Callers 1

Calls 2

snapshotGeneratedFilesFunction · 0.70
restoreGeneratedFilesFunction · 0.70

Tested by

no test coverage detected