Skip to content

Commit 08f8967

Browse files
committed
Vitest
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 8c69344 commit 08f8967

File tree

345 files changed

+116845
-187000
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

345 files changed

+116845
-187000
lines changed

.github/workflows/main.yml

+3-30
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
name: Builds, tests & co
22

33
on:
4-
push:
5-
pull_request:
6-
release:
7-
types:
8-
- published
4+
- push
5+
- pull_request
96

107
permissions: read-all
118

129
jobs:
1310
build-and-test:
1411
runs-on: ubuntu-latest
15-
1612
steps:
1713
- name: Checkout tree
1814
uses: actions/checkout@v4
@@ -30,27 +26,4 @@ jobs:
3026
run: yarn format:check
3127

3228
- name: Run the tests
33-
run: yarn test-all
34-
35-
publish:
36-
if: github.event_name == 'release'
37-
38-
needs:
39-
- build-and-test
40-
41-
runs-on: ubuntu-latest
42-
43-
steps:
44-
- name: Checkout tree
45-
uses: actions/checkout@v4
46-
47-
- name: Set-up Node.js
48-
uses: actions/setup-node@v4
49-
with:
50-
node-version: 22
51-
check-latest: true
52-
53-
- name: Publish
54-
run: yarn npm publish --tolerate-republish
55-
env:
56-
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
29+
run: yarn test

.github/workflows/publish.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
permissions: read-all
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout tree
15+
uses: actions/checkout@v4
16+
17+
- name: Set-up Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 22
21+
check-latest: true
22+
23+
- name: Publish
24+
run: yarn npm publish --tolerate-republish
25+
env:
26+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

biome.json

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
{
22
"$schema": "node_modules/@biomejs/biome/configuration_schema.json",
33
"files": {
4-
"ignore": [
5-
"package.json",
6-
"tests/**/expected.ts",
7-
"tests/**/expected/**",
8-
"tests/**/generated/**",
9-
"tests/**/schema.d.ts",
10-
"tests/**/schema.js",
11-
"tests/**/schema.ts"
12-
],
4+
"ignore": ["package.json"],
135
"maxSize": 10000000
146
},
157
"formatter": {

package.json

+4-57
Original file line numberDiff line numberDiff line change
@@ -30,61 +30,7 @@
3030
"cli:yaml": "node index.js -r -d -p ./swagger-test-cli.yaml -n swagger-test-cli.ts",
3131
"format": "biome format --write .",
3232
"format:check": "biome format .",
33-
"generate": "node tests/generate.js",
34-
"generate-extended": "node tests/generate-extended.js",
35-
"node": "node swagger-test-cli/generate.js",
36-
"node:debug": "node --nolazy swagger-test-cli/generate.js",
37-
"test-all": "yarn test-extended && yarn test-simple && yarn test-specific",
38-
"test-all(update-snapshots)": "cross-env UPDATE_SNAPSHOTS=true yarn test-all",
39-
"test-extended": "node --unhandled-rejections=strict scripts_runner.js generate-extended validate",
40-
"test-simple": "node --unhandled-rejections=strict scripts_runner.js generate validate",
41-
"test-specific": "node --unhandled-rejections=strict scripts_runner.js \"test:*\"",
42-
"test-specific(update-snapshots)": "cross-env UPDATE_SNAPSHOTS=true node --unhandled-rejections=strict scripts_runner.js \"test:*\"",
43-
"test:--add-readonly": "node tests/spec/readonly/test.js",
44-
"test:--another-array-type": "node tests/spec/another-array-type/test.js",
45-
"test:--axios": "node tests/spec/axios/test.js",
46-
"test:--axios--single-http-client": "node tests/spec/axiosSingleHttpClient/test.js",
47-
"test:--cli": "shx rm -rf tests/spec/cli/schema.ts && node index.js -p tests/spec/cli/schema.json -o tests/spec/cli -n schema.ts --extract-response-body --extract-response-error --api-class-name MySuperApi --type-prefix Prefix && node tests/spec/cli/test.js",
48-
"test:--default-as-success": "node tests/spec/defaultAsSuccess/test.js",
49-
"test:--default-response": "node tests/spec/defaultResponse/test.js",
50-
"test:--dot-path-params": "node tests/spec/dot-path-params/test.js",
51-
"test:--enum-names-as-values": "node tests/spec/enumNamesAsValues/test.js",
52-
"test:--extract-request-body": "node tests/spec/extractRequestBody/test.js",
53-
"test:--extract-request-params": "node tests/spec/extractRequestParams/test.js",
54-
"test:--extract-response-body": "node tests/spec/extractResponseBody/test.js",
55-
"test:--extract-response-error": "node tests/spec/extractResponseError/test.js",
56-
"test:--js": "node tests/spec/js/test.js",
57-
"test:--js--axios": "node tests/spec/jsAxios/test.js",
58-
"test:--modular": "node tests/spec/modular/test.js",
59-
"test:--module-name-first-tag": "node tests/spec/moduleNameFirstTag/test.js",
60-
"test:--module-name-index": "node tests/spec/moduleNameIndex/test.js",
61-
"test:--no-client": "node tests/spec/noClient/test.js",
62-
"test:--object-types": "node tests/spec/object-types/test.js",
63-
"test:--patch": "node tests/spec/patch/test.js",
64-
"test:--primitive-type-constructs": "node tests/spec/primitive-type-constructs/test.js",
65-
"test:--responses": "node tests/spec/responses/test.js",
66-
"test:--route-types": "node tests/spec/routeTypes/test.js",
67-
"test:--single-http-client": "node tests/spec/singleHttpClient/test.js",
68-
"test:--templates": "node tests/spec/templates/test.js",
69-
"test:--type-suffix--type-prefix": "node tests/spec/typeSuffixPrefix/test.js",
70-
"test:--union-enums": "node tests/spec/unionEnums/test.js",
71-
"test:additionalProperties2.0": "node tests/spec/additional-properties-2.0/test.js",
72-
"test:another-query-params": "node tests/spec/another-query-params/test.js",
73-
"test:const-keyword": "node tests/spec/const-keyword/test.js",
74-
"test:deprecated": "node tests/spec/deprecated/test.js",
75-
"test:discriminator": "node tests/spec/discriminator/test.js",
76-
"test:enums2.0": "node tests/spec/enums-2.0/test.js",
77-
"test:extra-templates": "node tests/spec/extra-templates/test.js",
78-
"test:extract-enums": "node tests/spec/extract-enums/test.js",
79-
"test:jsSingleHttpClientModular": "node tests/spec/jsSingleHttpClientModular/test.js",
80-
"test:nullableRefTest2.0": "node tests/spec/nullable-2.0/test.js",
81-
"test:nullableRefTest3.0": "node tests/spec/nullable-3.0/test.js",
82-
"test:on-insert-path-param": "node tests/spec/on-insert-path-param/test.js",
83-
"test:partialBaseTemplate": "node tests/spec/partialBaseTemplate/test.js",
84-
"test:partialDefaultTemplate": "node tests/spec/partialDefaultTemplate/test.js",
85-
"test:sort-types": "node tests/spec/sortTypes/test.js",
86-
"test:sort-types-false": "node tests/spec/sortTypes-false/test.js",
87-
"test:specProperty": "node tests/spec/specProperty/test.js",
33+
"test": "vitest run",
8834
"validate": "node tests/validate.js",
8935
"validate:debug": "node --nolazy tests/validate.js"
9036
},
@@ -99,7 +45,7 @@
9945
"node-emoji": "^2.1.3",
10046
"prettier": "3.3.2",
10147
"swagger-schema-official": "2.0.0-bab6bed",
102-
"swagger2openapi": "^7.0.8",
48+
"swagger2openapi": "7.0.8",
10349
"typescript": "5.4.5"
10450
},
10551
"devDependencies": {
@@ -110,7 +56,8 @@
11056
"cross-env": "7.0.3",
11157
"dotenv": "16.4.5",
11258
"git-diff": "2.0.6",
113-
"shx": "0.3.4"
59+
"shx": "0.3.4",
60+
"vitest": "1.6.0"
11461
},
11562
"packageManager": "[email protected]",
11663
"engines": {

scripts_runner.js

-63
This file was deleted.

tests/README.md

-14
This file was deleted.

0 commit comments

Comments
 (0)