mirror of
https://github.com/CompassConnections/Compass.git
synced 2025-12-23 22:18:43 -05:00
Add tests runs to all packages
This commit is contained in:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -32,7 +32,9 @@ jobs:
|
||||
run: npm run lint
|
||||
|
||||
- name: Run Jest tests
|
||||
run: npm run test:coverage
|
||||
env:
|
||||
NEXT_PUBLIC_FIREBASE_ENV: DEV
|
||||
run: yarn test
|
||||
|
||||
# - name: Build app
|
||||
# env:
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"verify:dir": "npx eslint . --max-warnings 0",
|
||||
"regen-types": "cd ../supabase && make ENV=prod regen-types",
|
||||
"regen-types-dev": "cd ../supabase && make ENV=dev regen-types-dev",
|
||||
"test": "jest"
|
||||
"test": "jest --config jest.config.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
|
||||
26
backend/email/jest.config.js
Normal file
26
backend/email/jest.config.js
Normal file
@@ -0,0 +1,26 @@
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
|
||||
rootDir: '.',
|
||||
testMatch: [
|
||||
"<rootDir>/tests/**/*.test.ts",
|
||||
"<rootDir>/tests/**/*.spec.ts"
|
||||
],
|
||||
|
||||
moduleNameMapper: {
|
||||
"^api/(.*)$": "<rootDir>/src/$1",
|
||||
"^shared/(.*)$": "<rootDir>/../shared/src/$1",
|
||||
"^common/(.*)$": "<rootDir>/../../common/src/$1",
|
||||
"^email/(.*)$": "<rootDir>/../email/emails/$1"
|
||||
},
|
||||
|
||||
moduleFileExtensions: ["ts", "js", "json"],
|
||||
clearMocks: true,
|
||||
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
tsconfig: '<rootDir>/tsconfig.json'
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -4,7 +4,8 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "email dev --port 3001",
|
||||
"build": "tsc -b"
|
||||
"build": "tsc -b",
|
||||
"test": "jest --config jest.config.js --passWithNoTests"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-email/components": "0.0.33",
|
||||
|
||||
26
backend/shared/jest.config.js
Normal file
26
backend/shared/jest.config.js
Normal file
@@ -0,0 +1,26 @@
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
|
||||
rootDir: '.',
|
||||
testMatch: [
|
||||
"<rootDir>/tests/**/*.test.ts",
|
||||
"<rootDir>/tests/**/*.spec.ts"
|
||||
],
|
||||
|
||||
moduleNameMapper: {
|
||||
"^api/(.*)$": "<rootDir>/src/$1",
|
||||
"^shared/(.*)$": "<rootDir>/../shared/src/$1",
|
||||
"^common/(.*)$": "<rootDir>/../../common/src/$1",
|
||||
"^email/(.*)$": "<rootDir>/../email/emails/$1"
|
||||
},
|
||||
|
||||
moduleFileExtensions: ["ts", "js", "json"],
|
||||
clearMocks: true,
|
||||
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
tsconfig: '<rootDir>/tsconfig.json'
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -6,7 +6,8 @@
|
||||
"build": "tsc -b && yarn --cwd=../../common tsc-alias && tsc-alias",
|
||||
"compile": "tsc -b",
|
||||
"verify": "yarn --cwd=../.. verify",
|
||||
"verify:dir": "npx eslint . --max-warnings 0"
|
||||
"verify:dir": "npx eslint . --max-warnings 0",
|
||||
"test": "jest --config jest.config.js --passWithNoTests"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"dependencies": {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"compile": "tsc -b",
|
||||
"verify": "yarn --cwd=.. verify",
|
||||
"verify:dir": "npx eslint . --max-warnings 0",
|
||||
"test": "jest"
|
||||
"test": "jest --config jest.config.js --passWithNoTests"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"dependencies": {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"build-sync-android": "./scripts/build_sync_android.sh",
|
||||
"sync-android": "./scripts/sync_android.sh",
|
||||
"migrate": "./scripts/migrate.sh",
|
||||
"test": "jest",
|
||||
"test": "yarn workspaces run test",
|
||||
"test:coverage": "jest --coverage",
|
||||
"test:watch": "jest --watch",
|
||||
"test:update": "jest --updateSnapshot",
|
||||
|
||||
26
web/jest.config.js
Normal file
26
web/jest.config.js
Normal file
@@ -0,0 +1,26 @@
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
|
||||
rootDir: '.',
|
||||
testMatch: [
|
||||
"<rootDir>/tests/**/*.test.ts",
|
||||
"<rootDir>/tests/**/*.spec.ts"
|
||||
],
|
||||
|
||||
moduleNameMapper: {
|
||||
"^api/(.*)$": "<rootDir>/src/$1",
|
||||
"^shared/(.*)$": "<rootDir>/../shared/src/$1",
|
||||
"^common/(.*)$": "<rootDir>/../../common/src/$1",
|
||||
"^email/(.*)$": "<rootDir>/../email/emails/$1"
|
||||
},
|
||||
|
||||
moduleFileExtensions: ["ts", "js", "json"],
|
||||
clearMocks: true,
|
||||
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
tsconfig: '<rootDir>/tsconfig.json'
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -17,7 +17,8 @@
|
||||
"format": "npx prettier --write .",
|
||||
"format-changed": "cd .. && git diff $(git merge-base --fork-point main) --name-only --diff-filter=d | xargs npx prettier -w",
|
||||
"verify": "(cd .. && yarn verify)",
|
||||
"verify:dir": "npx prettier --check .; yarn lint --max-warnings 0; tsc --pretty --project tsconfig.json --noEmit"
|
||||
"verify:dir": "npx prettier --check .; yarn lint --max-warnings 0; tsc --pretty --project tsconfig.json --noEmit",
|
||||
"test": "jest --config jest.config.js --passWithNoTests"
|
||||
},
|
||||
"dependencies": {
|
||||
"@floating-ui/react": "0.19.0",
|
||||
|
||||
Reference in New Issue
Block a user