chore: unit tests to check loading and bundling api definitions with openapi-core (#1568)

This commit is contained in:
Andriy Leliv 2021-04-08 18:45:55 +03:00 committed by GitHub
parent 503394655d
commit 5a9154ab1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3145 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View 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();
});
});