Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ssukienn committed Dec 5, 2023
1 parent 2ba55e7 commit 8b5fae6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion example/typescript-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"nestjs-swagger-api-spec": "^0.0.2",
"nestjs-swagger-api-spec": "^1.0.0",
"nestjs-swagger-api-spec-local": "file:../..",
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
Expand Down
8 changes: 4 additions & 4 deletions example/typescript-starter/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions example/typescript-starter/src/app.controller.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Controller, Get } from '@nestjs/common';
import { ApiSpecification } from 'nestjs-swagger-api-spec';
import { appControllerOpenApiSpec, appHelloHandlerOpenApiSpec } from './app.open-api';
import {
appControllerOpenApiSpec,
appHelloHandlerOpenApiSpec,
} from './app.open-api';
import { AppService } from './app.service';

@ApiSpecification(appControllerOpenApiSpec)
@ApiOperation
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
Expand All @@ -14,5 +16,4 @@ export class AppController {
getHello(): string {
return this.appService.getHello();
}

}
15 changes: 9 additions & 6 deletions example/typescript-starter/src/app.open-api.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { ApiOptions } from "nestjs-swagger-api-spec"
import { ApiOptions } from 'nestjs-swagger-api-spec';

export const appControllerOpenApiSpec: ApiOptions = {
apiResponseOptions: apiDecorator => [apiDecorator({status: 200, type: String})]

}
apiResponseOptions: (apiDecorator) => [
apiDecorator({ status: 211, type: String }),
],
};

export const appHelloHandlerOpenApiSpec: ApiOptions = {
apiResponseOptions: apiDecorator => [apiDecorator({status: 211, type: Number})]
}
apiResponseOptions: (apiDecorator) => [
apiDecorator({ status: 222, type: Number }),
],
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build": "tsup lib/index.ts --format cjs,esm --dts-resolve --clean",
"release": "pnpm run build && changeset publish",
"lint": "tsc",
"test": "cd example/typescript-starter && pnpm i && pnpm run test",
"test": "pnpm run \"/^test:.*/\" --color",
"test:lib": "pnpm jest",
"test:e2e": "cd example/typescript-starter && pnpm i && pnpm run test:e2e"
},
"peerDependencies": {
Expand Down

0 comments on commit 8b5fae6

Please sign in to comment.