Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: setup unit and integration testing #3

Merged
merged 12 commits into from
Nov 17, 2024
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "tutortoise-test"
}
}
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ jobs:
- name: Run Linting
run: pnpm run lint

- name: Run Tests
run: |
npm install -g firebase-tools
firebase emulators:exec --only auth,firestore --project tutortoise-test 'pnpm run test'
env:
FIREBASE_AUTH_EMULATOR_HOST: 127.0.0.1:9090
FIREBASE_DATABASE_EMULATOR_HOST: 127.0.0.1:9000
GCS_BUCKET_NAME: tutortoise-test

- name: Build Project
run: pnpm run build


17 changes: 17 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"emulators": {
"auth": {
"port": 9099
},
"firestore": {
"port": 9090
},
"database": {
"port": 9000
},
"ui": {
"enabled": true
},
"singleProjectMode": false
}
}
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"dev": "tsx --watch src/main.ts",
"lint": "prettier --check .",
"format": "prettier --write .",
"seed": "tsx src/seed.ts"
"seed": "tsx src/seed.ts",
"test": "NODE_ENV=test vitest"
},
"dependencies": {
"@google-cloud/storage": "^7.14.0",
Expand All @@ -34,9 +35,12 @@
"@types/express": "^5.0.0",
"@types/morgan": "^1.9.9",
"@types/multer": "^1.4.12",
"@types/supertest": "^6.0.2",
"prettier": "^3.3.3",
"supertest": "^7.0.0",
"tsc-alias": "^1.8.10",
"tsx": "^4.19.2",
"typescript": "^5.6.3"
"typescript": "^5.6.3",
"vitest": "^2.1.5"
}
}
Loading