From 2bb84d3992662a9862848d34b10308da0ff8328e Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Thu, 19 Feb 2026 17:01:19 +0100 Subject: [PATCH] Fix --- common/.eslintrc.js | 16 +++++++++++++++- common/{src => tests/unit}/socials.test.ts | 4 ++-- common/tsconfig.json | 8 +++++++- common/tsconfig.test.json | 13 +++++++++++++ 4 files changed, 37 insertions(+), 4 deletions(-) rename common/{src => tests/unit}/socials.test.ts (97%) create mode 100644 common/tsconfig.test.json diff --git a/common/.eslintrc.js b/common/.eslintrc.js index 8c11c157..03e87e6c 100644 --- a/common/.eslintrc.js +++ b/common/.eslintrc.js @@ -1,7 +1,7 @@ module.exports = { plugins: ['lodash', 'unused-imports'], extends: ['eslint:recommended'], - ignorePatterns: ['lib', 'coverage', 'tests', 'jest.config.js'], + ignorePatterns: ['lib', 'coverage', 'jest.config.js'], env: { node: true, }, @@ -33,6 +33,20 @@ module.exports = { 'no-constant-condition': 'off', }, }, + { + "files": ["**/*.test.ts", "**/*.test.tsx", "**/tests/**/*.ts"], + "env": { + "jest": true // makes expect, describe, it globals known + }, + "rules": { + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-non-null-assertion": "off" + }, + parserOptions: { + tsconfigRootDir: __dirname, + project: ['./tsconfig.test.json'], + }, + } ], rules: { 'linebreak-style': [ diff --git a/common/src/socials.test.ts b/common/tests/unit/socials.test.ts similarity index 97% rename from common/src/socials.test.ts rename to common/tests/unit/socials.test.ts index b9287d06..fe85cf87 100644 --- a/common/src/socials.test.ts +++ b/common/tests/unit/socials.test.ts @@ -1,5 +1,5 @@ -import { strip, getSocialUrl } from './socials' -import {discordLink} from "common/constants"; +import {getSocialUrl, strip} from '../../src/socials' +import {discordLink} from "common/src/constants"; describe('strip', () => { describe('x/twitter', () => { diff --git a/common/tsconfig.json b/common/tsconfig.json index 2506d8d5..066a916d 100644 --- a/common/tsconfig.json +++ b/common/tsconfig.json @@ -15,5 +15,11 @@ "common/*": ["./src/*", "../lib/*"] } }, - "include": ["src/**/*.ts"] + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "**/*.test.ts", + "**/*.spec.ts" + ] } diff --git a/common/tsconfig.test.json b/common/tsconfig.test.json new file mode 100644 index 00000000..ee5962c5 --- /dev/null +++ b/common/tsconfig.test.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "types": [ + "jest" + ] + }, + "include": [ + "src/**/*.ts", + "tests/**/*.ts" + ], + "exclude": [] +}