Skip to content

Commit 85abf22

Browse files
committed
Fix Tests and Github Action flow
1 parent 413c5a1 commit 85abf22

File tree

5 files changed

+191
-40
lines changed

5 files changed

+191
-40
lines changed

.github/workflows/push.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Node.js CI
2+
on:
3+
push:
4+
branches: [ main ]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
ref: ${{ github.ref }}
12+
- name: "cat package.json"
13+
run: cat ./package.json
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: 12
18+
- run: npm ci
19+
- run: npm run prepublishOnly
20+
- run: npm run test
21+
22+
- name: "Automated Version Bump"
23+
id: version-bump
24+
uses: "phips28/gh-action-bump-version@master"
25+
with:
26+
tag-prefix: ''
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
- name: "cat package.json"
30+
run: cat ./package.json
31+
- name: 'Output Step'
32+
env:
33+
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
34+
run: echo "new tag $NEW_TAG"
35+
36+
- name: "Publish to NPM"
37+
uses: JS-DevTools/npm-publish@v1
38+
with:
39+
token: ${{ secrets.NPM_TOKEN }}
40+
41+

jest.config.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@
5555
"test:e2e": "jest --selectProjects E2E --runInBand",
5656
"eslint": "eslint .",
5757
"eslint:fix": "eslint . --fix",
58-
"prepublishOnly": "yarn run clean && yarn run release",
59-
"codecov": "codecov --token=66c30c23-8954-4892-bef9-fbaed0a2e42b"
58+
"prepublishOnly": "npm run clean && npm run release"
6059
},
6160
"dependencies": {
6261
"@types/node-fetch": "^2.5.12",

test/__snapshots__/index.client.spec.js.snap

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5546,6 +5546,21 @@ export type CompositionWithOneOfAnonymous = {
55465546
"
55475547
`;
55485548

5549+
exports[`v3 should generate with exportClient: ./test/generated/v3_client/models/CompositionWithOneOfDiscriminator.ts 1`] = `
5550+
"/* istanbul ignore file */
5551+
/* tslint:disable */
5552+
/* eslint-disable */
5553+
5554+
import type { ModelCircle } from './ModelCircle';
5555+
import type { ModelSquare } from './ModelSquare';
5556+
5557+
/**
5558+
* This is a model with one property with a 'one of' relationship where the options are not $ref
5559+
*/
5560+
export type CompositionWithOneOfDiscriminator = (ModelCircle | ModelSquare);
5561+
"
5562+
`;
5563+
55495564
exports[`v3 should generate with exportClient: ./test/generated/v3_client/models/DictionaryWithArray.ts 1`] = `
55505565
"/* istanbul ignore file */
55515566
/* tslint:disable */
@@ -5685,6 +5700,51 @@ export enum EnumWithStrings {
56855700
}"
56865701
`;
56875702

5703+
exports[`v3 should generate with exportClient: ./test/generated/v3_client/models/File.ts 1`] = `
5704+
"/* istanbul ignore file */
5705+
/* tslint:disable */
5706+
/* eslint-disable */
5707+
5708+
export type File = {
5709+
readonly id?: string;
5710+
readonly updated_at?: string;
5711+
readonly created_at?: string;
5712+
mime: string;
5713+
readonly file?: string;
5714+
}
5715+
"
5716+
`;
5717+
5718+
exports[`v3 should generate with exportClient: ./test/generated/v3_client/models/ModelCircle.ts 1`] = `
5719+
"/* istanbul ignore file */
5720+
/* tslint:disable */
5721+
/* eslint-disable */
5722+
5723+
/**
5724+
* Circle
5725+
*/
5726+
export type ModelCircle = {
5727+
kind: 'circle';
5728+
radius?: number;
5729+
}
5730+
"
5731+
`;
5732+
5733+
exports[`v3 should generate with exportClient: ./test/generated/v3_client/models/ModelSquare.ts 1`] = `
5734+
"/* istanbul ignore file */
5735+
/* tslint:disable */
5736+
/* eslint-disable */
5737+
5738+
/**
5739+
* Square
5740+
*/
5741+
export type ModelSquare = {
5742+
kind: 'square';
5743+
sideLength?: number;
5744+
}
5745+
"
5746+
`;
5747+
56885748
exports[`v3 should generate with exportClient: ./test/generated/v3_client/models/ModelThatExtends.ts 1`] = `
56895749
"/* istanbul ignore file */
56905750
/* tslint:disable */
@@ -6455,6 +6515,21 @@ export const $CompositionWithOneOfAnonymous = {
64556515
} as const;"
64566516
`;
64576517

6518+
exports[`v3 should generate with exportClient: ./test/generated/v3_client/schemas/$CompositionWithOneOfDiscriminator.ts 1`] = `
6519+
"/* istanbul ignore file */
6520+
/* tslint:disable */
6521+
/* eslint-disable */
6522+
export const $CompositionWithOneOfDiscriminator = {
6523+
type: 'one-of',
6524+
description: \`This is a model with one property with a 'one of' relationship where the options are not $ref\`,
6525+
contains: [{
6526+
type: 'ModelCircle',
6527+
}, {
6528+
type: 'ModelSquare',
6529+
}],
6530+
} as const;"
6531+
`;
6532+
64586533
exports[`v3 should generate with exportClient: ./test/generated/v3_client/schemas/$DictionaryWithArray.ts 1`] = `
64596534
"/* istanbul ignore file */
64606535
/* tslint:disable */
@@ -6564,6 +6639,78 @@ export const $EnumWithStrings = {
65646639
} as const;"
65656640
`;
65666641

6642+
exports[`v3 should generate with exportClient: ./test/generated/v3_client/schemas/$File.ts 1`] = `
6643+
"/* istanbul ignore file */
6644+
/* tslint:disable */
6645+
/* eslint-disable */
6646+
export const $File = {
6647+
properties: {
6648+
id: {
6649+
type: 'string',
6650+
isReadOnly: true,
6651+
minLength: 1,
6652+
},
6653+
updated_at: {
6654+
type: 'string',
6655+
isReadOnly: true,
6656+
format: 'date-time',
6657+
},
6658+
created_at: {
6659+
type: 'string',
6660+
isReadOnly: true,
6661+
format: 'date-time',
6662+
},
6663+
mime: {
6664+
type: 'string',
6665+
isRequired: true,
6666+
maxLength: 24,
6667+
minLength: 1,
6668+
},
6669+
file: {
6670+
type: 'string',
6671+
isReadOnly: true,
6672+
format: 'uri',
6673+
},
6674+
},
6675+
} as const;"
6676+
`;
6677+
6678+
exports[`v3 should generate with exportClient: ./test/generated/v3_client/schemas/$ModelCircle.ts 1`] = `
6679+
"/* istanbul ignore file */
6680+
/* tslint:disable */
6681+
/* eslint-disable */
6682+
export const $ModelCircle = {
6683+
description: \`Circle\`,
6684+
properties: {
6685+
kind: {
6686+
type: 'string',
6687+
isRequired: true,
6688+
},
6689+
radius: {
6690+
type: 'number',
6691+
},
6692+
},
6693+
} as const;"
6694+
`;
6695+
6696+
exports[`v3 should generate with exportClient: ./test/generated/v3_client/schemas/$ModelSquare.ts 1`] = `
6697+
"/* istanbul ignore file */
6698+
/* tslint:disable */
6699+
/* eslint-disable */
6700+
export const $ModelSquare = {
6701+
description: \`Square\`,
6702+
properties: {
6703+
kind: {
6704+
type: 'string',
6705+
isRequired: true,
6706+
},
6707+
sideLength: {
6708+
type: 'number',
6709+
},
6710+
},
6711+
} as const;"
6712+
`;
6713+
65676714
exports[`v3 should generate with exportClient: ./test/generated/v3_client/schemas/$ModelThatExtends.ts 1`] = `
65686715
"/* istanbul ignore file */
65696716
/* tslint:disable */

test/__snapshots__/index.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export type OpenAPIConfig = {
185185
BASE?: string;
186186
VERSION?: string;
187187
WITH_CREDENTIALS?: boolean;
188-
CREDENTIALS: 'include' | 'omit' | 'same-origin';
188+
CREDENTIALS?: 'include' | 'omit' | 'same-origin';
189189
TOKEN?: string | Resolver<string>;
190190
USERNAME?: string | Resolver<string>;
191191
PASSWORD?: string | Resolver<string>;
@@ -2902,7 +2902,7 @@ export type OpenAPIConfig = {
29022902
BASE?: string;
29032903
VERSION?: string;
29042904
WITH_CREDENTIALS?: boolean;
2905-
CREDENTIALS: 'include' | 'omit' | 'same-origin';
2905+
CREDENTIALS?: 'include' | 'omit' | 'same-origin';
29062906
TOKEN?: string | Resolver<string>;
29072907
USERNAME?: string | Resolver<string>;
29082908
PASSWORD?: string | Resolver<string>;

0 commit comments

Comments
 (0)