From 0443ff4b16805681062fba97e65503f4dc129c2d Mon Sep 17 00:00:00 2001 From: Kamaal Farah Date: Sun, 21 Apr 2024 13:29:58 +0200 Subject: [PATCH] Testing from src --- .eslintrc.js | 2 +- jest.config.ts | 2 +- package.json | 2 +- {tests => src}/objects/omit.test.ts | 2 +- tsconfig.json | 3 +++ tsconfig.tests.json | 3 ++- 6 files changed, 9 insertions(+), 5 deletions(-) rename {tests => src}/objects/omit.test.ts (89%) diff --git a/.eslintrc.js b/.eslintrc.js index fefb0de..78c039c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,7 +17,7 @@ module.exports = { }, overrides: [ { - files: ['./tests/**/*.ts'], + files: ['./src/**/*.test.ts'], parserOptions: { project: './tsconfig.tests.json', }, diff --git a/jest.config.ts b/jest.config.ts index c46c958..e5af5f4 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -126,7 +126,7 @@ const config: Config = { // rootDir: undefined, // A list of paths to directories that Jest should use to search for files in - roots: ['tests'], + roots: ['src'], // Allows you to use a custom runner instead of Jest's default test runner // runner: "jest-runner", diff --git a/package.json b/package.json index 4c61df3..8712954 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "scripts": { "build": "tsc", "test": "jest", - "lint": "eslint src/index.ts src/**/*.ts tests/**/*.ts", + "lint": "eslint src/index.ts src/**/*.ts", "prepare": "husky", "prepublish": "rm -rf dist && yarn build" }, diff --git a/tests/objects/omit.test.ts b/src/objects/omit.test.ts similarity index 89% rename from tests/objects/omit.test.ts rename to src/objects/omit.test.ts index 23ab750..b4dd506 100644 --- a/tests/objects/omit.test.ts +++ b/src/objects/omit.test.ts @@ -1,4 +1,4 @@ -import { omit } from '../../src/objects'; +import omit from './omit'; describe('omit', () => { it('omits', () => { diff --git a/tsconfig.json b/tsconfig.json index dc15a18..4025b49 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,9 @@ "include": [ "src" ], + "exclude": [ + "src/**/*.test.ts" + ], "compilerOptions": { /* Visit https://aka.ms/tsconfig to read more about this file */ diff --git a/tsconfig.tests.json b/tsconfig.tests.json index 63f834a..bf79d91 100644 --- a/tsconfig.tests.json +++ b/tsconfig.tests.json @@ -1,4 +1,5 @@ { "extends": "./tsconfig.json", - "include": ["tests"] + "include": ["src/**/*.test.ts"], + "exclude": [] }