Skip to content

Vitest #738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 3 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
name: Builds, tests & co

on:
push:
pull_request:
release:
types:
- published
- push
- pull_request

permissions: read-all

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout tree
uses: actions/checkout@v4
Expand All @@ -30,27 +26,4 @@ jobs:
run: yarn format:check

- name: Run the tests
run: yarn test-all

publish:
if: github.event_name == 'release'

needs:
- build-and-test

runs-on: ubuntu-latest

steps:
- name: Checkout tree
uses: actions/checkout@v4

- name: Set-up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
check-latest: true

- name: Publish
run: yarn npm publish --tolerate-republish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: yarn test
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish

on:
release:
types:
- published

permissions: read-all

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout tree
uses: actions/checkout@v4

- name: Set-up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
check-latest: true

- name: Publish
run: yarn npm publish --tolerate-republish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
10 changes: 1 addition & 9 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
{
"$schema": "node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"ignore": [
"package.json",
"tests/**/expected.ts",
"tests/**/expected/**",
"tests/**/generated/**",
"tests/**/schema.d.ts",
"tests/**/schema.js",
"tests/**/schema.ts"
],
"ignore": ["package.json"],
"maxSize": 10000000
},
"formatter": {
Expand Down
61 changes: 4 additions & 57 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,61 +30,7 @@
"cli:yaml": "node index.js -r -d -p ./swagger-test-cli.yaml -n swagger-test-cli.ts",
"format": "biome format --write .",
"format:check": "biome format .",
"generate": "node tests/generate.js",
"generate-extended": "node tests/generate-extended.js",
"node": "node swagger-test-cli/generate.js",
"node:debug": "node --nolazy swagger-test-cli/generate.js",
"test-all": "yarn test-extended && yarn test-simple && yarn test-specific",
"test-all(update-snapshots)": "cross-env UPDATE_SNAPSHOTS=true yarn test-all",
"test-extended": "node --unhandled-rejections=strict scripts_runner.js generate-extended validate",
"test-simple": "node --unhandled-rejections=strict scripts_runner.js generate validate",
"test-specific": "node --unhandled-rejections=strict scripts_runner.js \"test:*\"",
"test-specific(update-snapshots)": "cross-env UPDATE_SNAPSHOTS=true node --unhandled-rejections=strict scripts_runner.js \"test:*\"",
"test:--add-readonly": "node tests/spec/readonly/test.js",
"test:--another-array-type": "node tests/spec/another-array-type/test.js",
"test:--axios": "node tests/spec/axios/test.js",
"test:--axios--single-http-client": "node tests/spec/axiosSingleHttpClient/test.js",
"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",
"test:--default-as-success": "node tests/spec/defaultAsSuccess/test.js",
"test:--default-response": "node tests/spec/defaultResponse/test.js",
"test:--dot-path-params": "node tests/spec/dot-path-params/test.js",
"test:--enum-names-as-values": "node tests/spec/enumNamesAsValues/test.js",
"test:--extract-request-body": "node tests/spec/extractRequestBody/test.js",
"test:--extract-request-params": "node tests/spec/extractRequestParams/test.js",
"test:--extract-response-body": "node tests/spec/extractResponseBody/test.js",
"test:--extract-response-error": "node tests/spec/extractResponseError/test.js",
"test:--js": "node tests/spec/js/test.js",
"test:--js--axios": "node tests/spec/jsAxios/test.js",
"test:--modular": "node tests/spec/modular/test.js",
"test:--module-name-first-tag": "node tests/spec/moduleNameFirstTag/test.js",
"test:--module-name-index": "node tests/spec/moduleNameIndex/test.js",
"test:--no-client": "node tests/spec/noClient/test.js",
"test:--object-types": "node tests/spec/object-types/test.js",
"test:--patch": "node tests/spec/patch/test.js",
"test:--primitive-type-constructs": "node tests/spec/primitive-type-constructs/test.js",
"test:--responses": "node tests/spec/responses/test.js",
"test:--route-types": "node tests/spec/routeTypes/test.js",
"test:--single-http-client": "node tests/spec/singleHttpClient/test.js",
"test:--templates": "node tests/spec/templates/test.js",
"test:--type-suffix--type-prefix": "node tests/spec/typeSuffixPrefix/test.js",
"test:--union-enums": "node tests/spec/unionEnums/test.js",
"test:additionalProperties2.0": "node tests/spec/additional-properties-2.0/test.js",
"test:another-query-params": "node tests/spec/another-query-params/test.js",
"test:const-keyword": "node tests/spec/const-keyword/test.js",
"test:deprecated": "node tests/spec/deprecated/test.js",
"test:discriminator": "node tests/spec/discriminator/test.js",
"test:enums2.0": "node tests/spec/enums-2.0/test.js",
"test:extra-templates": "node tests/spec/extra-templates/test.js",
"test:extract-enums": "node tests/spec/extract-enums/test.js",
"test:jsSingleHttpClientModular": "node tests/spec/jsSingleHttpClientModular/test.js",
"test:nullableRefTest2.0": "node tests/spec/nullable-2.0/test.js",
"test:nullableRefTest3.0": "node tests/spec/nullable-3.0/test.js",
"test:on-insert-path-param": "node tests/spec/on-insert-path-param/test.js",
"test:partialBaseTemplate": "node tests/spec/partialBaseTemplate/test.js",
"test:partialDefaultTemplate": "node tests/spec/partialDefaultTemplate/test.js",
"test:sort-types": "node tests/spec/sortTypes/test.js",
"test:sort-types-false": "node tests/spec/sortTypes-false/test.js",
"test:specProperty": "node tests/spec/specProperty/test.js",
"test": "vitest run",
"validate": "node tests/validate.js",
"validate:debug": "node --nolazy tests/validate.js"
},
Expand All @@ -99,7 +45,7 @@
"node-emoji": "^2.1.3",
"prettier": "3.3.2",
"swagger-schema-official": "2.0.0-bab6bed",
"swagger2openapi": "^7.0.8",
"swagger2openapi": "7.0.8",
"typescript": "5.4.5"
},
"devDependencies": {
Expand All @@ -110,7 +56,8 @@
"cross-env": "7.0.3",
"dotenv": "16.4.5",
"git-diff": "2.0.6",
"shx": "0.3.4"
"shx": "0.3.4",
"vitest": "1.6.0"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
63 changes: 0 additions & 63 deletions scripts_runner.js

This file was deleted.

14 changes: 0 additions & 14 deletions tests/README.md

This file was deleted.

Loading
Loading