From 6e9207a7c790fb3297ae837ccbfc4aa4addbec53 Mon Sep 17 00:00:00 2001 From: Linus Willner Date: Thu, 25 Jan 2024 00:09:15 +0200 Subject: [PATCH] Ensure lint runs on src folder, narrow Jest test discovery Jest would catch test files outside the test folder if named correctly. Unlikely, but possible --- jest.config.js | 3 ++- jest.coverage.js | 3 ++- tsconfig.eslint.json | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/jest.config.js b/jest.config.js index 758fa13..227f135 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,4 +1,5 @@ module.exports = { preset: 'ts-jest', - testEnvironment: 'node' + testEnvironment: 'node', + testRegex: 'test/.*\\.test\\.ts$' } diff --git a/jest.coverage.js b/jest.coverage.js index 6c13377..19dcf7a 100644 --- a/jest.coverage.js +++ b/jest.coverage.js @@ -5,5 +5,6 @@ module.exports = { '/node_modules/' ], preset: 'ts-jest', - testEnvironment: 'node' + testEnvironment: 'node', + testRegex: 'test/.*\\.test\\.ts$' } diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index df16a2a..c844e8e 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -4,6 +4,7 @@ }, "extends": "./tsconfig.json", "include": [ + "src", "test", "jest.*.js" ]