Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,19 @@ jobs:
- name: Run type check
run: npm run type-check || echo "Type check not configured"

- name: Run tests
run: npm test -- --coverage --watchAll=false --passWithNoTests
- name: Run tests with coverage
run: npm run test:coverage -- --passWithNoTests

- name: Build frontend
run: npm run build

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: ./frontend/coverage/lcov.info
flags: frontend
name: frontend-coverage
token: ${{ secrets.CODECOV_TOKEN }}

test-backend:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -75,17 +76,18 @@ jobs:
- name: Build backend
run: npm run build

- name: Run tests
run: npm test || echo "Tests not fully configured yet"
- name: Run tests with coverage
run: npm run test:coverage || echo "Tests not fully configured yet"
env:
NODE_ENV: test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: ./backend/coverage/lcov.info
flags: backend
name: backend-coverage
token: ${{ secrets.CODECOV_TOKEN }}

security-audit:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# NASA Space Explorer 🚀

[![codecov](https://codecov.io/gh/TonyCasey/nasa-explorer/branch/main/graph/badge.svg)](https://codecov.io/gh/TonyCasey/nasa-explorer)

**Version 2.1.4** - UI Improvements & Enhanced Readability Release

A full-stack web application that showcases NASA's space data through modern web technologies. This interactive platform provides access to stunning space imagery, Mars rover photos, Near Earth Object tracking, and more.
Expand Down Expand Up @@ -307,3 +309,6 @@ This project is built for educational purposes as part of the Bounce Insights co
**Live URLs:**
- Frontend: https://nasa.tonycasey.dev/
- Backend: https://nasa-server.tonycasey.dev/

## Code Coverage

48 changes: 48 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
coverage:
status:
project:
default:
target: 80%
threshold: 2%
base: auto
patch:
default:
target: 80%
threshold: 2%
base: auto

codecov:
require_ci_to_pass: true
notify:
after_n_builds: 2 # Wait for both frontend and backend

flags:
frontend:
paths:
- frontend/src/
carryforward: false
backend:
paths:
- backend/src/
carryforward: false

coverage:
precision: 2
round: down
range: 70..100

ignore:
- "frontend/src/index.tsx"
- "frontend/src/reportWebVitals.ts"
- "frontend/src/setupTests.ts"
- "frontend/src/**/*.test.{ts,tsx}"
- "frontend/src/**/__tests__/**"
- "backend/src/**/*.d.ts"
- "backend/src/types/**"
- "backend/src/server.ts"
- "backend/src/test/**"
- "**/*.config.js"
- "**/node_modules/**"
- "**/coverage/**"
- "**/dist/**"
- "**/build/**"
13 changes: 12 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"test:coverage": "react-scripts test --coverage --watchAll=false",
"eject": "react-scripts eject",
"lint": "eslint src --ext .ts,.tsx",
"lint:fix": "eslint src --ext .ts,.tsx --fix",
Expand All @@ -49,7 +50,17 @@
"moduleNameMapper": {
"^axios$": "axios/dist/node/axios.cjs",
"^react-router-dom$": "<rootDir>/src/__mocks__/react-router-dom.js"
}
},
"collectCoverageFrom": [
"src/**/*.{ts,tsx}",
"!src/**/*.d.ts",
"!src/index.tsx",
"!src/reportWebVitals.ts",
"!src/setupTests.ts",
"!src/**/*.test.{ts,tsx}",
"!src/**/__tests__/**"
],
"coverageReporters": ["text", "lcov", "html", "json"]
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const Dashboard: React.FC = () => {
</h1>
<p className="text-gray-300 text-lg max-w-2xl mx-auto">
Real-time monitoring of NASA space data, missions, and celestial
events - now with automated CI/CD deployment! 🛰️
events!🛰️
</p>
</div>

Expand Down
Loading
Loading