@@ -2,22 +2,26 @@ import assert from "assert"
2
2
import getHumidex from "../../src/weather/getHumidex.js"
3
3
4
4
describe ( "getHumidex" , ( ) => {
5
- it ( "should return the humidex (41) given temperature (30 C) and humidity (%70 )" , ( ) => {
5
+ it ( "should return the humidex (41) given temperature (30 C) and humidity (70% )" , ( ) => {
6
6
const humidex = getHumidex ( 30 , 70 )
7
7
assert . equal ( humidex , 41 )
8
8
} )
9
- it ( "should return the humidex (29) given temperature (21 C) and humidity (% 100)" , ( ) => {
9
+ it ( "should return the humidex (29) given temperature (21 C) and humidity (100% )" , ( ) => {
10
10
const humidex = getHumidex ( 21 , 100 )
11
11
assert . equal ( humidex , 29 )
12
12
} )
13
- it ( "should return the humidex (47) given temperature (43 C) and humidity (%20 )" , ( ) => {
13
+ it ( "should return the humidex (47) given temperature (43 C) and humidity (20% )" , ( ) => {
14
14
const humidex = getHumidex ( 43 , 20 )
15
15
assert . equal ( humidex , 47 )
16
16
} )
17
- it ( "should return the humidex (59) given temperature (35 C) and humidity (%95 )" , ( ) => {
17
+ it ( "should return the humidex (59) given temperature (35 C) and humidity (95% )" , ( ) => {
18
18
const humidex = getHumidex ( 35 , 95 )
19
19
assert . equal ( humidex , 59 )
20
20
} )
21
+ it ( "should return the temperature (21 C) (with humidity (20%)) if humidex is less than the temperature" , ( ) => {
22
+ const humidex = getHumidex ( 21 , 20 )
23
+ assert . equal ( humidex , 21 )
24
+ } )
21
25
it ( "should throw error when humidex is not between 0 and 100" , ( ) => {
22
26
assert . throws ( ( ) => getHumidex ( 30 , 105 ) )
23
27
} )
0 commit comments