mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
add tests infrastructure
This commit is contained in:
1
broker/.gitignore
vendored
1
broker/.gitignore
vendored
@@ -5,3 +5,4 @@ dist
|
|||||||
scripts/start_dev.js
|
scripts/start_dev.js
|
||||||
package-lock.json
|
package-lock.json
|
||||||
build_all.bat
|
build_all.bat
|
||||||
|
tests
|
||||||
13
broker/jest.config.js
Normal file
13
broker/jest.config.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/** @type {import('ts-jest').JestConfigWithTsJest} **/
|
||||||
|
module.exports = {
|
||||||
|
testEnvironment: "node",
|
||||||
|
transform: {
|
||||||
|
"^.+.tsx?$": ["ts-jest",{}],
|
||||||
|
},
|
||||||
|
moduleNameMapper: {
|
||||||
|
'@services/(.*)': '<rootDir>/../shared/services/$1',
|
||||||
|
'@data/(.*)': '<rootDir>/../shared/data/$1',
|
||||||
|
'@functions/(.*)': '<rootDir>/../shared/functions/$1',
|
||||||
|
'@schema/(.*)': '<rootDir>/../shared/schema/$1',
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -8,13 +8,17 @@
|
|||||||
"ua-parser-js": "^1.0.37"
|
"ua-parser-js": "^1.0.37"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@jest/globals": "^29.7.0",
|
||||||
"@types/cors": "^2.8.17",
|
"@types/cors": "^2.8.17",
|
||||||
"@types/express": "^4.17.21",
|
"@types/express": "^4.17.21",
|
||||||
|
"@types/jest": "^29.5.12",
|
||||||
"@types/node": "^20.12.13",
|
"@types/node": "^20.12.13",
|
||||||
"@types/nodemailer": "^6.4.15",
|
"@types/nodemailer": "^6.4.15",
|
||||||
"@types/ua-parser-js": "^0.7.39",
|
"@types/ua-parser-js": "^0.7.39",
|
||||||
"glob": "^10.4.1",
|
"glob": "^10.4.1",
|
||||||
|
"jest": "^29.7.0",
|
||||||
"node-ssh": "^13.2.0",
|
"node-ssh": "^13.2.0",
|
||||||
|
"ts-jest": "^29.2.5",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.4.5"
|
"typescript": "^5.4.5"
|
||||||
},
|
},
|
||||||
@@ -28,7 +32,8 @@
|
|||||||
"create_db": "cd scripts && ts-node create_database.ts",
|
"create_db": "cd scripts && ts-node create_database.ts",
|
||||||
"build_all": "npm run compile && npm run build && npm run create_db",
|
"build_all": "npm run compile && npm run build && npm run create_db",
|
||||||
"docker-build": "docker build -t litlyx-broker -f Dockerfile ../",
|
"docker-build": "docker build -t litlyx-broker -f Dockerfile ../",
|
||||||
"docker-inspect": "docker run -it litlyx-broker sh"
|
"docker-inspect": "docker run -it litlyx-broker sh",
|
||||||
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "Emily",
|
"author": "Emily",
|
||||||
|
|||||||
2439
broker/pnpm-lock.yaml
generated
2439
broker/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,14 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
"module": "NodeNext",
|
"module": "NodeNext",
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
|
"types": [
|
||||||
|
"node",
|
||||||
|
"jest"
|
||||||
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@schema/*": [
|
"@schema/*": [
|
||||||
"../shared/schema/*"
|
"../shared/schema/*"
|
||||||
@@ -21,7 +26,9 @@
|
|||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
"scripts/**/*.ts"
|
"scripts/**/*.ts",
|
||||||
|
"tests/**/*.test.ts",
|
||||||
|
"tests/utils.ts",
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
|
|||||||
Reference in New Issue
Block a user