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

on:
push:
branches: [main]
pull_request:
branches: [main]
push:
branches: [main]

jobs:
Expand All @@ -25,12 +25,12 @@ jobs:
- name: Build TypeScript
run: npm run build

- name: Run Tests with Vitest
run: npm run test

- name: Run ESLint
run: npm run lint

- name: Run Tests with Vitest
run: npm run test

# 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:
# DOCKER_USERNAME – your Docker Hub username
Expand Down
2 changes: 1 addition & 1 deletion src/test/sensor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
});

it("returns false for values above 100", () => {
expect(isValidSensorValue(101)).toBe(false);
expect(isValidSensorValue(101)).toBe(true);

Check failure on line 14 in src/test/sensor.test.ts

View workflow job for this annotation

GitHub Actions / build-and-test

src/test/sensor.test.ts > isValidSensorValue() > returns false for values above 100

AssertionError: expected false to be true // Object.is equality - Expected + Received - true + false ❯ src/test/sensor.test.ts:14:37
});
});
12 changes: 12 additions & 0 deletions src/test/turnOnFan.tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { describe, it, expect } from 'vitest';
import { turnOnFan } from '../turnOnFan';

describe('turnOnFan', () => {
it('should return true when isHot is true', () => {
expect(turnOnFan(true)).toBe(true);
});

it('Failing test', () => {
expect(turnOnFan(false)).toBe(true);
});
});
3 changes: 3 additions & 0 deletions src/turnOnFan.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function turnOnFan(isHot: boolean): boolean {
return isHot;
}
Loading