mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 16:46:34 +03:00
chore: unit tests to check loading and bundling api definitions with openapi-core (#1568)
This commit is contained in:
parent
503394655d
commit
5a9154ab1d
3127
src/utils/__tests__/__snapshots__/loadAndBundleSpec.test.ts.snap
Normal file
3127
src/utils/__tests__/__snapshots__/loadAndBundleSpec.test.ts.snap
Normal file
File diff suppressed because it is too large
Load Diff
18
src/utils/__tests__/loadAndBundleSpec.test.ts
Normal file
18
src/utils/__tests__/loadAndBundleSpec.test.ts
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import * as yaml from 'yaml-js';
|
||||||
|
import { readFileSync } from 'fs';
|
||||||
|
import { resolve } from 'path';
|
||||||
|
import { loadAndBundleSpec } from '../loadAndBundleSpec';
|
||||||
|
|
||||||
|
describe('#loadAndBundleSpec', () => {
|
||||||
|
it('should load And Bundle Spec demo/openapi.yaml', async () => {
|
||||||
|
const spec = yaml.load(readFileSync(resolve(__dirname, '../../../demo/openapi.yaml')));
|
||||||
|
const bundledSpec = await loadAndBundleSpec(spec);
|
||||||
|
expect(bundledSpec).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should load And Bundle Spec demo/swagger.yaml', async () => {
|
||||||
|
const spec = yaml.load(readFileSync(resolve(__dirname, '../../../demo/swagger.yaml')));
|
||||||
|
const bundledSpec = await loadAndBundleSpec(spec);
|
||||||
|
expect(bundledSpec).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user