lint everything, disable some setup steps for jest (#8423)

This commit is contained in:
Ulf Gebhardt 2025-04-24 22:39:32 +02:00 committed by GitHub
parent d4cc843662
commit 2369d13ca2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 5 deletions

3
backend/.eslintignore Normal file
View File

@ -0,0 +1,3 @@
node_modules/
build/
coverage/

View File

@ -12,7 +12,7 @@
"build": "tsc && tsc-alias && ./scripts/build.copy.files.sh",
"dev": "nodemon --exec ts-node --require tsconfig-paths/register src/ -e js,ts,gql",
"dev:debug": "nodemon --exec babel-node --inspect=0.0.0.0:9229 src/ -e js,ts,gql",
"lint": "eslint --max-warnings=0 --ext .js,.ts ./src",
"lint": "eslint --max-warnings=0 --ext .js,.ts .",
"test": "cross-env NODE_ENV=test NODE_OPTIONS=--max-old-space-size=8192 jest --runInBand --coverage --forceExit --detectOpenHandles",
"db:reset": "ts-node --require tsconfig-paths/register src/db/reset.ts",
"db:reset:withmigrations": "ts-node --require tsconfig-paths/register src/db/reset-with-migrations.ts",

View File

@ -1,8 +1,10 @@
// Polyfill missing encoders in jsdom
// https://stackoverflow.com/questions/68468203/why-am-i-getting-textencoder-is-not-defined-in-jest
import { TextEncoder, TextDecoder } from 'util'
global.TextEncoder = TextEncoder
global.TextDecoder = TextDecoder as any
// import { TextEncoder, TextDecoder } from 'util'
// global.TextEncoder = TextEncoder
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
// global.TextDecoder = TextDecoder as any
// Metascraper takes longer nowadays, double time
jest.setTimeout(10000)
// jest.setTimeout(10000)