Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI

on:
push:
push: #
branches: [main]
pull_request:
branches: [main]
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/temperature.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export function isOverheating(temp: number): boolean {
return temp > 70;
}

export function isUnderheating(temp: number): boolean {
return temp < 0;
}
12 changes: 11 additions & 1 deletion src/test/temperature.test.ts
Original file line number Diff line number Diff line change
@@ -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", () => {
Expand All @@ -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);
});
});