Skip to content

Commit 3ee405b

Browse files
committed
made test case insensitive
1 parent 1906e53 commit 3ee405b

File tree

1 file changed

+10
-2
lines changed
  • exercises/07-Very-Specific-Rules

1 file changed

+10
-2
lines changed

exercises/07-Very-Specific-Rules/tests.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe("All the styles should be applied", ()=>{
2626
}
2727
let reg = new RegExp(/color:\s*red\s*!important\s*;/gm)
2828

29-
expect(reg.test(color)).toBeTruthy();
29+
expect(reg.test(color.toLowerCase())).toBeTruthy();
3030
});
3131

3232
test("The ol second element background should be green", ()=>{
@@ -44,6 +44,14 @@ describe("All the styles should be applied", ()=>{
4444

4545
}
4646

47+
if(background){
48+
background = background.toLowerCase()
49+
}
50+
51+
if(backgroundColor){
52+
backgroundColor = backgroundColor.toLowerCase()
53+
}
54+
4755
} expect(background === 'green' || backgroundColor === 'green').toBeTruthy();
4856
})
4957

@@ -62,7 +70,7 @@ describe("All the styles should be applied", ()=>{
6270

6371
}
6472

65-
} expect(background === "yellow" || backgroundColor === "yellow").toBeTruthy();
73+
} expect(background.toLowerCase() === "yellow" || backgroundColor.toLowerCase() === "yellow").toBeTruthy();
6674
})
6775

6876
test("Write all your rules above the existing code", ()=>{

0 commit comments

Comments
 (0)