From fe2df63e5fa3a0591297eb5c93222326b003ab5a Mon Sep 17 00:00:00 2001 From: Jaden Despeines Date: Mon, 15 Sep 2025 13:51:25 -0400 Subject: [PATCH 1/3] added temp tests --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 675c540..f8a8d7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ name: CI on: - push: + push: # branches: [main] pull_request: branches: [main] @@ -28,7 +28,7 @@ jobs: - name: Run Tests with Vitest run: npm run test - - name: Run ESLint + - name: Run ESLint # run: npm run lint # FOR IT TO WORK WITH GITHUB Actions and push to Docker registry do the following From 722f796d09f7f2bcb4068b7358e0715005ae5706 Mon Sep 17 00:00:00 2001 From: Jaden Despeines Date: Mon, 15 Sep 2025 13:55:23 -0400 Subject: [PATCH 2/3] temt testing --- src/test/temperature.test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/test/temperature.test.ts b/src/test/temperature.test.ts index 3f58906..22eeefa 100644 --- a/src/test/temperature.test.ts +++ b/src/test/temperature.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from "vitest"; -import { isOverheating } from "../temperature"; +import { isOverheating, isUnderheating } from "../temperature"; describe("isOverheating", () => { it("returns true if temp is above 70", () => { @@ -10,3 +10,13 @@ describe("isOverheating", () => { expect(isOverheating(70)).toBe(false); }); }); + +describe("isUnderheating", () => { + it("returns true if temp is below 0", () => { + expect(isUnderheating(-5)).toBe(true); + }); + + it("returns false if temp is 0 or above", () => { + expect(isUnderheating(0)).toBe(false); + }); +}); From 3f3fb77feff1354cf8190ee9e829ec74bee2036e Mon Sep 17 00:00:00 2001 From: Jaden Despeines Date: Mon, 15 Sep 2025 14:50:02 -0400 Subject: [PATCH 3/3] fixed temperature underheating implementation --- src/temperature.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/temperature.ts b/src/temperature.ts index 3fdc768..3076581 100644 --- a/src/temperature.ts +++ b/src/temperature.ts @@ -1,3 +1,7 @@ export function isOverheating(temp: number): boolean { return temp > 70; } + +export function isUnderheating(temp: number): boolean { + return temp < 0; +}