Skip to content

Commit

Permalink
Merge pull request #25 from samchon/features/test
Browse files Browse the repository at this point in the history
Enhance test program configuration
  • Loading branch information
samchon authored Jul 3, 2024
2 parents abf243a + bd2712a commit 1524482
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 23 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@samchon/openapi",
"version": "0.3.0-dev.20240703",
"version": "0.3.0",
"description": "OpenAPI definitions and converters for 'typia' and 'nestia'.",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"scripts": {
"prepare": "ts-patch install",
"build": "npm run build:main && npm run build:test",
"build:main": "rimraf lib && tsc",
"build:test": "rimraf bin && tsc -p tsconfig.test.json",
"build:test": "rimraf bin && tsc -p test/tsconfig.json",
"dev": "npm run build:test -- --watch",
"test": "node bin/test"
},
Expand All @@ -30,6 +30,7 @@
"homepage": "https://github.com/samchon/openapi",
"devDependencies": {
"@nestia/e2e": "^0.6.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/node": "^20.12.7",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
Expand Down
5 changes: 5 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ module.exports = {
semi: true,
tabWidth: 2,
trailingComma: "all",
plugins: [require.resolve("@trivago/prettier-plugin-sort-imports")],
importOrder: ["<THIRD_PARTY_MODULES>", "^[./]"],
importOrderSeparation: true,
importOrderSortSpecifiers: true,
importOrderParserPlugins: ["decorators-legacy", "typescript"],
};
4 changes: 2 additions & 2 deletions test/features/test_downgrade_v20.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { OpenApi, SwaggerV2 } from "../../src";
import { TestValidator } from "@nestia/e2e";
import { SwaggerV2Downgrader } from "../../src/internal/SwaggerV2Downgrader";
import { OpenApi, SwaggerV2 } from "@samchon/openapi";
import { SwaggerV2Downgrader } from "@samchon/openapi/lib/internal/SwaggerV2Downgrader";

export const test_downgrade_v20 = () => {
const schema: OpenApi.IJsonSchema = {
Expand Down
4 changes: 2 additions & 2 deletions test/features/test_downgrade_v30.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { OpenApi, OpenApiV3 } from "../../src";
import { OpenApiV3Downgrader } from "../../src/internal/OpenApiV3Downgrader";
import { TestValidator } from "@nestia/e2e";
import { OpenApi, OpenApiV3 } from "@samchon/openapi";
import { OpenApiV3Downgrader } from "@samchon/openapi/lib/internal/OpenApiV3Downgrader";

export const test_downgrade_v30 = () => {
const schema: OpenApi.IJsonSchema = {
Expand Down
12 changes: 6 additions & 6 deletions test/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import fs from "fs";
import path from "path";
import typia from "typia";

import {
IMigrateDocument,
OpenApi,
OpenApiV3,
OpenApiV3_1,
SwaggerV2,
} from "../src";
import { test_downgrade_v30 } from "./features/test_downgrade_v30";
} from "@samchon/openapi";
import fs from "fs";
import path from "path";
import typia from "typia";

import { test_downgrade_v20 } from "./features/test_downgrade_v20";
import { test_downgrade_v30 } from "./features/test_downgrade_v30";

const CONVERTED: string = `${__dirname}/../../examples/converted`;

Expand Down
15 changes: 15 additions & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../bin",
"paths": {
"@samchon/openapi": ["../src/index.ts"],
"@samchon/openapi/lib/*": ["../src/*"],
},
"plugins": [
{ "transform": "typia/lib/transform" },
{ "transform": "typescript-transform-paths" },
]
},
"include": ["../src", "../test"]
}
11 changes: 0 additions & 11 deletions tsconfig.test.json

This file was deleted.

0 comments on commit 1524482

Please sign in to comment.