From 53fbb6dbb8c66f65e747cfc6ed48b14002301bf9 Mon Sep 17 00:00:00 2001 From: AmauryD Date: Sat, 10 Sep 2022 00:51:36 +0200 Subject: [PATCH] move tests in separate folder --- package.json | 9 ++++----- src/index.spec.ts => tests/validator.test.ts | 6 +++--- tsconfig.json | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) rename src/index.spec.ts => tests/validator.test.ts (99%) diff --git a/package.json b/package.json index 9735f75..c1f13cf 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,7 @@ "prepublish": "pnpm run test && pnpm run build" }, "files": [ - "dist/index.d.ts", - "dist/index.js" + "dist/src" ], "keywords": [ "validation", @@ -33,8 +32,8 @@ "typescript", "decorators" ], - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "devDependencies": { "@types/jest": "^29.0.0", "@types/node": "^18.7.3", @@ -66,7 +65,7 @@ "^.+\\.(ts|tsx)$": "ts-jest" }, "testMatch": [ - "**/*.spec.(ts|js)" + "**/*.test.(ts|js)" ], "testPathIgnorePatterns": [ "/dist/" diff --git a/src/index.spec.ts b/tests/validator.test.ts similarity index 99% rename from src/index.spec.ts rename to tests/validator.test.ts index 13a0133..ef2218f 100644 --- a/src/index.spec.ts +++ b/tests/validator.test.ts @@ -23,9 +23,9 @@ import { Custom } from "../src/index"; import type { ValidationError } from "fastest-validator"; -import { COMPILE_KEY } from "./constants"; -import { validate } from "./utils/validate"; -import { validateOrReject } from "./utils/validate-or-reject"; +import { COMPILE_KEY } from "../src/constants"; +import { validate } from "../src/utils/validate"; +import { validateOrReject } from "../src/utils/validate-or-reject"; describe("Schema", () => { it("Should default to not strict", () => { diff --git a/tsconfig.json b/tsconfig.json index dacf8a4..a7b8ede 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "outDir": "dist", - "rootDir": "src", + "rootDir": ".", "esModuleInterop": true, "experimentalDecorators": true, "emitDecoratorMetadata": true,