Skip to content

Commit 387bd18

Browse files
test: constrict lower bounds and upper bounds of test case (#2742)
* test: constrict lower bounds and upper bounds of test case I recently mentored a solution where the mentee used `>=100` and it passed. I'm making this PR to fix that. Link to solution: https://exercism.org/mentoring/requests/dad84dead4344defb12e2788a142713b * [CI] Format code * chore: include contributor name in meta --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent f4b8c6d commit 387bd18

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

exercises/concept/factory-sensors/.meta/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"contributors": [
66
"SleeplessByte",
77
"junedev",
8-
"themetar"
8+
"themetar",
9+
"orimdominic"
910
],
1011
"files": {
1112
"solution": [

exercises/concept/factory-sensors/factory-sensors.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@ import {
88
} from './factory-sensors';
99

1010
describe('checkHumidityLevel', () => {
11+
test('should throw if the humidity percentage is 71', () => {
12+
expect(() => checkHumidityLevel(71)).toThrow();
13+
});
14+
1115
test('should throw if the humidity percentage is 100', () => {
1216
expect(() => checkHumidityLevel(100)).toThrow();
1317
});
1418

19+
test('should not throw if the humidity level is 70', () => {
20+
expect(() => checkHumidityLevel(70)).not.toThrow();
21+
});
22+
1523
test('should not throw if the humidity level is 53', () => {
1624
expect(() => checkHumidityLevel(53)).not.toThrow();
1725
});

0 commit comments

Comments
 (0)