From 71eb21a644919b21dd99bd1f1e14e6806388a227 Mon Sep 17 00:00:00 2001 From: Mishka Sonavadekar Date: Mon, 15 Sep 2025 15:55:35 -0400 Subject: [PATCH 1/2] Mishka S. test --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 675c540..6f8e4e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,14 +22,18 @@ jobs: - name: Install dependencies run: npm install + - name: Run ESLint + run: npm run lint + - name: Build TypeScript run: npm run build - name: Run Tests with Vitest run: npm run test - - name: Run ESLint - run: npm run lint + + + # FOR IT TO WORK WITH GITHUB Actions and push to Docker registry do the following # In your repo settings, go to Settings → Secrets and variables → Actions → Secrets, and add: From 7f6d17e64fac3f4206587e1acb42b03c1c19c2f9 Mon Sep 17 00:00:00 2001 From: Mishka Sonavadekar Date: Mon, 15 Sep 2025 17:41:03 -0400 Subject: [PATCH 2/2] Mishka S. new changes --- .github/workflows/ci.yml | 13 +++++++------ src/LedBlue.ts | 3 +++ src/index.ts | 2 +- src/test/ledBlue.test.ts | 2 ++ 4 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 src/LedBlue.ts create mode 100644 src/test/ledBlue.test.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f8e4e6..c922a39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,11 @@ name: CI on: - push: - branches: [main] + pull_request: branches: [main] + push: + branches: [main] jobs: build-and-test: @@ -17,13 +18,12 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "22" + node-version: "18" - name: Install dependencies run: npm install - - name: Run ESLint - run: npm run lint + - name: Build TypeScript run: npm run build @@ -31,7 +31,8 @@ jobs: - name: Run Tests with Vitest run: npm run test - + - name: Run ESLint + run: npm run lint diff --git a/src/LedBlue.ts b/src/LedBlue.ts new file mode 100644 index 0000000..86dca87 --- /dev/null +++ b/src/LedBlue.ts @@ -0,0 +1,3 @@ +export function isLedBlue(red: boolean, green: boolean, blue: boolean): boolean{ + return red == false && green == false && blue == true; +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 4491af4..1375169 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,4 +14,4 @@ app.get("/", (req: Request, res: Response) => { // Start the server app.listen(PORT, () => { console.log(`Server is running on http://localhost:${PORT}`); -}); +}); \ No newline at end of file diff --git a/src/test/ledBlue.test.ts b/src/test/ledBlue.test.ts new file mode 100644 index 0000000..fe0c3e3 --- /dev/null +++ b/src/test/ledBlue.test.ts @@ -0,0 +1,2 @@ +import { describe, it, expect } from "vitest"; +import { isOverheating } from "../temperature";