mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
- Checking order of tests
This commit is contained in:
parent
4ceabd8bba
commit
75aee5f577
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openapi-typescript-codegen",
|
||||
"version": "0.3.1",
|
||||
"version": "0.4.0",
|
||||
"description": "NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification.",
|
||||
"author": "Ferdi Koomen",
|
||||
"homepage": "https://github.com/ferdikoomen/openapi-typescript-codegen",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -4,50 +4,50 @@ const OpenAPI = require('../dist');
|
||||
const glob = require('glob');
|
||||
const fs = require('fs');
|
||||
|
||||
describe('generation', () => {
|
||||
describe('v2', () => {
|
||||
it('generated v2', async () => {
|
||||
await OpenAPI.generate({
|
||||
input: './test/mock/v2/spec.json',
|
||||
output: './test/result/v2/',
|
||||
httpClient: OpenAPI.HttpClient.FETCH,
|
||||
useOptions: true,
|
||||
useUnionTypes: true,
|
||||
exportCore: true,
|
||||
exportSchemas: true,
|
||||
exportModels: true,
|
||||
exportServices: true,
|
||||
});
|
||||
});
|
||||
|
||||
const files = glob.sync('./test/result/v2/**/*.ts');
|
||||
|
||||
test.each(files.map(file => [file]))('file(%s)', file => {
|
||||
const content = fs.readFileSync(file, 'utf8').toString();
|
||||
expect(content).toMatchSnapshot(file);
|
||||
});
|
||||
});
|
||||
|
||||
describe('v3', () => {
|
||||
it('generated v3', async () => {
|
||||
await OpenAPI.generate({
|
||||
input: './test/mock/v3/spec.json',
|
||||
output: './test/result/v3/',
|
||||
httpClient: OpenAPI.HttpClient.FETCH,
|
||||
useOptions: true,
|
||||
useUnionTypes: true,
|
||||
exportCore: true,
|
||||
exportSchemas: true,
|
||||
exportModels: true,
|
||||
exportServices: true,
|
||||
});
|
||||
});
|
||||
|
||||
const files = glob.sync('./test/result/v3/**/*.ts');
|
||||
|
||||
test.each(files.map(file => [file]))('file(%s)', file => {
|
||||
const content = fs.readFileSync(file, 'utf8').toString();
|
||||
expect(content).toMatchSnapshot(file);
|
||||
describe('v2', () => {
|
||||
it('should generate', async () => {
|
||||
await OpenAPI.generate({
|
||||
input: './test/mock/v2/spec.json',
|
||||
output: './test/result/v2/',
|
||||
httpClient: OpenAPI.HttpClient.FETCH,
|
||||
useOptions: true,
|
||||
useUnionTypes: true,
|
||||
exportCore: true,
|
||||
exportSchemas: true,
|
||||
exportModels: true,
|
||||
exportServices: true,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('v3', () => {
|
||||
it('should generate', async () => {
|
||||
await OpenAPI.generate({
|
||||
input: './test/mock/v3/spec.json',
|
||||
output: './test/result/v3/',
|
||||
httpClient: OpenAPI.HttpClient.FETCH,
|
||||
useOptions: true,
|
||||
useUnionTypes: true,
|
||||
exportCore: true,
|
||||
exportSchemas: true,
|
||||
exportModels: true,
|
||||
exportServices: true,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('v2 (snapshot)', () => {
|
||||
const files = glob.sync('./test/result/v2/**/*.ts');
|
||||
test.each(files.map(file => [file]))('file(%s)', file => {
|
||||
const content = fs.readFileSync(file, 'utf8').toString();
|
||||
expect(content).toMatchSnapshot(file);
|
||||
});
|
||||
});
|
||||
|
||||
describe('v3 (snapshot)', () => {
|
||||
const files = glob.sync('./test/result/v3/**/*.ts');
|
||||
test.each(files.map(file => [file]))('file(%s)', file => {
|
||||
const content = fs.readFileSync(file, 'utf8').toString();
|
||||
expect(content).toMatchSnapshot(file);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user