Skip to content

Commit

Permalink
Debugger setting
Browse files Browse the repository at this point in the history
  • Loading branch information
samchon committed Nov 12, 2024
1 parent 8054b93 commit 5795815
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 16 deletions.
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "TypeScript Test using SourceMap",
"program": "${workspaceFolder}/test/index.ts",
"runtimeArgs": [
"--require",
"ts-node/register",
//----
// You can run specific test functions
//----
// "--include", "llm",
// "--exclude", "chatgpt",
],
"env": {
"TS_NODE_PROJECT": "test/tsconfig.json",
},
},
],
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@samchon/openapi",
"version": "2.0.0-dev.20241111-3",
"version": "2.0.0-dev.20241113",
"description": "OpenAPI definitions and converters for 'typia' and 'nestia'.",
"main": "./lib/index.js",
"module": "./lib/index.mjs",
Expand Down Expand Up @@ -52,8 +52,9 @@
"rimraf": "^5.0.5",
"rollup": "^4.18.1",
"source-map-support": "^0.5.21",
"ts-node": "^10.9.2",
"ts-patch": "^3.2.1",
"typescript": "5.5.4",
"typescript": "^5.6.3",
"typescript-transform-paths": "^3.4.7",
"typia": "^6.9.0",
"uuid": "^10.0.0"
Expand All @@ -63,6 +64,5 @@
"lib",
"src",
"README.md"
],
"packageManager": "[email protected]+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
]
}
6 changes: 6 additions & 0 deletions test/TestGlobal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export namespace TestGlobal {
export const ROOT: string =
__filename.substring(__filename.length - 2) === "js"
? `${__dirname}/../..`
: `${__dirname}/..`;
}
2 changes: 1 addition & 1 deletion test/features/llm/test_llm_merge_value.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TestValidator } from "@nestia/e2e";
import { HttpLlm } from "@samchon/openapi";

export const test_llm_merge_parameters = (): void => {
export const test_llm_merge_value = (): void => {
TestValidator.equals("number")(HttpLlm.mergeValue(1, 2))(2);
TestValidator.equals("nullable")(HttpLlm.mergeValue(0, null))(0);
TestValidator.equals("optional")(HttpLlm.mergeValue(0, undefined))(0);
Expand Down
4 changes: 3 additions & 1 deletion test/features/migrate/test_http_migrate_route_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import {
} from "@samchon/openapi";
import fs from "fs";

import { TestGlobal } from "../../TestGlobal";

export const test_http_migrate_route_comment = async (): Promise<void> => {
const swagger: OpenApi.IDocument = OpenApi.convert(
JSON.parse(
await fs.promises.readFile(
`${__dirname}/../../../../examples/v3.1/shopping.json`,
`${TestGlobal.ROOT}/examples/v3.1/shopping.json`,
"utf8",
),
),
Expand Down
4 changes: 3 additions & 1 deletion test/features/migrate/test_http_migrate_v20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import {
import fs from "fs";
import typia from "typia";

import { TestGlobal } from "../../TestGlobal";

export const test_http_migrate_v20 = async (): Promise<void> => {
const path: string = `${__dirname}/../../../../examples/v2.0`;
const path: string = `${TestGlobal.ROOT}/examples/v2.0`;
for (const file of await fs.promises.readdir(path)) {
if (file.endsWith(".json") === false) continue;
const swagger: SwaggerV2.IDocument = typia.assert<SwaggerV2.IDocument>(
Expand Down
4 changes: 3 additions & 1 deletion test/features/migrate/test_http_migrate_v30.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import {
import fs from "fs";
import typia from "typia";

import { TestGlobal } from "../../TestGlobal";

export const test_http_migrate_v30 = async (): Promise<void> => {
const path: string = `${__dirname}/../../../../examples/v3.0`;
const path: string = `${TestGlobal.ROOT}/examples/v3.0`;
for (const file of await fs.promises.readdir(path)) {
if (file.endsWith(".json") === false) continue;
const swagger: OpenApiV3.IDocument = typia.assert<OpenApiV3.IDocument>(
Expand Down
4 changes: 3 additions & 1 deletion test/features/migrate/test_http_migrate_v31.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import {
import fs from "fs";
import typia from "typia";

import { TestGlobal } from "../../TestGlobal";

export const test_http_migrate_v31 = async (): Promise<void> => {
const path: string = `${__dirname}/../../../../examples/v3.1`;
const path: string = `${TestGlobal.ROOT}/examples/v3.1`;
for (const file of await fs.promises.readdir(path)) {
if (file.endsWith(".json") === false) continue;
const swagger: OpenApiV3_1.IDocument = typia.assert<OpenApiV3_1.IDocument>(
Expand Down
4 changes: 3 additions & 1 deletion test/features/openapi/test_document_convert_v20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { OpenApi, SwaggerV2 } from "@samchon/openapi";
import fs from "fs";
import typia from "typia";

import { TestGlobal } from "../../TestGlobal";

export const test_document_convert_v20 = async (): Promise<void> => {
const path: string = `${__dirname}/../../../../examples/v2.0`;
const path: string = `${TestGlobal.ROOT}/examples/v2.0`;
for (const file of await fs.promises.readdir(path)) {
if (file.endsWith(".json") === false) continue;
const swagger: SwaggerV2.IDocument = typia.assert<SwaggerV2.IDocument>(
Expand Down
4 changes: 3 additions & 1 deletion test/features/openapi/test_document_convert_v30.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { OpenApi, OpenApiV3 } from "@samchon/openapi";
import fs from "fs";
import typia from "typia";

import { TestGlobal } from "../../TestGlobal";

export const test_document_convert_v30 = async (): Promise<void> => {
const path: string = `${__dirname}/../../../../examples/v3.0`;
const path: string = `${TestGlobal.ROOT}/examples/v3.0`;
for (const file of await fs.promises.readdir(path)) {
if (file.endsWith(".json") === false) continue;
const swagger: OpenApiV3.IDocument = typia.assert<OpenApiV3.IDocument>(
Expand Down
4 changes: 3 additions & 1 deletion test/features/openapi/test_document_convert_v31.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { OpenApi, OpenApiV3_1 } from "@samchon/openapi";
import fs from "fs";
import typia from "typia";

import { TestGlobal } from "../../TestGlobal";

export const test_document_convert_v31 = async (): Promise<void> => {
const path: string = `${__dirname}/../../../../examples/v3.1`;
const path: string = `${TestGlobal.ROOT}/examples/v3.1`;
for (const file of await fs.promises.readdir(path)) {
if (file.endsWith(".json") === false) continue;
const swagger: OpenApiV3_1.IDocument = typia.assert<OpenApiV3_1.IDocument>(
Expand Down
4 changes: 3 additions & 1 deletion test/features/openapi/test_document_downgrade_v20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { OpenApi, OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@samchon/openapi";
import fs from "fs";
import typia from "typia";

import { TestGlobal } from "../../TestGlobal";

export const test_document_downgrade_v20 = async (): Promise<void> => {
const path: string = `${__dirname}/../../../../examples/v3.1`;
const path: string = `${TestGlobal.ROOT}/examples/v3.1`;
for (const directory of await fs.promises.readdir(path)) {
const stats: fs.Stats = await fs.promises.lstat(`${path}/${directory}`);
if (stats.isDirectory() === false) continue;
Expand Down
4 changes: 3 additions & 1 deletion test/features/openapi/test_document_downgrade_v30.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { OpenApi, OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@samchon/openapi";
import fs from "fs";
import typia from "typia";

import { TestGlobal } from "../../TestGlobal";

export const test_document_downgrade_v30 = async (): Promise<void> => {
const path: string = `${__dirname}/../../../../examples/v3.1`;
const path: string = `${TestGlobal.ROOT}/examples/v3.1`;
for (const directory of await fs.promises.readdir(path)) {
const stats: fs.Stats = await fs.promises.lstat(`${path}/${directory}`);
if (stats.isDirectory() === false) continue;
Expand Down
1 change: 1 addition & 0 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const main = async (): Promise<void> => {
const report: DynamicExecutor.IReport = await DynamicExecutor.validate({
prefix: "test_",
location: __dirname + "/features",
extension: __filename.substring(__filename.length - 2),
parameters: () => [
{
host: `http://localhost:3000`,
Expand Down
5 changes: 3 additions & 2 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "ESNext",
"target": "ES2015",
"outDir": "../bin",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
Expand All @@ -16,5 +16,6 @@
{ "transform": "@nestia/core/lib/transform" },
]
},
"include": ["../src", "../test"]
"include": ["../src", "./"],
"exclude": ["../node_modules"]
}

0 comments on commit 5795815

Please sign in to comment.