Skip to content

Commit 6ea8c33

Browse files
authored
fix(curriculum): use specific assert methods in flappy penguin workshop (freeCodeCamp#59907)
1 parent 9a86afc commit 6ea8c33

21 files changed

Lines changed: 40 additions & 40 deletions

curriculum/challenges/english/25-front-end-development/workshop-flappy-penguin/619665c9abd72906f3ad30f9.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ assert.exists(document.querySelector('link'));
2323
Your `link` element should be within your `head` element.
2424

2525
```js
26-
assert(code.match(/<head>[\w\W\s]*<link[\w\W\s]*\/?>[\w\W\s]*<\/head>/i));
26+
assert.match(code, /<head>[\w\W\s]*<link[\w\W\s]*\/?>[\w\W\s]*<\/head>/i);
2727
```
2828

2929
Your `link` element should have a `rel` attribute with the value `stylesheet`.

curriculum/challenges/english/25-front-end-development/workshop-flappy-penguin/619692ff79f5770fc6d8c0b4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Above the `.ground` element, add a `div` with a `class` of `penguin`. This `div`
1414
You should add a new `div` within the `body`.
1515

1616
```js
17-
assert.equal(document.querySelectorAll('body > div')?.length, 2);
17+
assert.lengthOf(document.querySelectorAll('body > div'), 2);
1818
```
1919

2020
You should give the `div` a `class` of `penguin`.

curriculum/challenges/english/25-front-end-development/workshop-flappy-penguin/61969aa6acef5b12200f672e.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Above the `.penguin` element, add a `div` with a `class` of `left-mountain`.
1616
You should add a new `div` within `body`. Expected to see `--fcc-expected--` `div` elements, but found `--fcc-actual--`.
1717

1818
```js
19-
assert.equal(document.querySelectorAll('body > div')?.length, 3);
19+
assert.lengthOf(document.querySelectorAll('body > div'), 3);
2020
```
2121

2222
You should give the `div` a `class` of `left-mountain`.

curriculum/challenges/english/25-front-end-development/workshop-flappy-penguin/6196ce0415498d2463989e84.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To give the effect of a mountain range, add another mountain, by creating a new
1414
You should add a new `div` within `body`.
1515

1616
```js
17-
assert.equal(document.querySelectorAll('body > div')?.length, 4);
17+
assert.lengthOf(document.querySelectorAll('body > div'), 4);
1818
```
1919

2020
You should give the `div` a `class` of `back-mountain`.

curriculum/challenges/english/25-front-end-development/workshop-flappy-penguin/6196d213d99f16287bff22ae.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To finish the background, add a sun, by creating a new `div` element immediately
1414
You should add a new `div` element to `body`. Expected `--fcc-expected--` `div` elements, but found `--fcc-actual--`.
1515

1616
```js
17-
assert.equal(document.querySelectorAll('body > div')?.length, 5);
17+
assert.lengthOf(document.querySelectorAll('body > div'), 5);
1818
```
1919

2020
You should give the new `div` element a `class` of `sun`.

curriculum/challenges/english/25-front-end-development/workshop-flappy-penguin/6197cff995d03905b0cca8ad.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Within `.penguin`, add two new `div` elements. The first with a `class` of `peng
1616
You should add two new `div` elements to `.penguin`. Expected `--fcc-expected--` `.penguin > div` elements, but found `--fcc-actual--`.
1717

1818
```js
19-
assert.equal(document.querySelectorAll('.penguin > div')?.length, 2);
19+
assert.lengthOf(document.querySelectorAll('.penguin > div'), 2);
2020
```
2121

2222
You should give the first `div` a `class` of `penguin-head`.

curriculum/challenges/english/25-front-end-development/workshop-flappy-penguin/619be946958c6009844f1dee.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Start the penguin's face, by adding two `div` elements within `.penguin-head`, a
1414
You should add `--fcc-expected--` `div` elements to `.penguin-head`, but found `--fcc-actual--`.
1515

1616
```js
17-
assert.equal(document.querySelectorAll('.penguin-head > div')?.length, 2);
17+
assert.lengthOf(document.querySelectorAll('.penguin-head > div'), 2);
1818
```
1919

2020
You should give the first `div` a `class` of `face`, but found `--fcc-actual--`.

curriculum/challenges/english/25-front-end-development/workshop-flappy-penguin/619d033915012509031f309a.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Below the `.face.right` element, add a `div` element with a `class` of `chin`.
1414
You should add one `div` element within `.penguin-head`. Expected `--fcc-expected--` `div` elements, found `--fcc-actual--`.
1515

1616
```js
17-
assert.equal(document.querySelectorAll('.penguin-head > div')?.length, 3);
17+
assert.lengthOf(document.querySelectorAll('.penguin-head > div'), 3);
1818
```
1919

2020
You should give the `div` a `class` of `chin`.

curriculum/challenges/english/25-front-end-development/workshop-flappy-penguin/619d090cd8d6db0c93dc5087.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Below the `.chin` element, add two `div` elements each with a `class` of `eye`.
1414
You should add two `div` elements within `.penguin-head`. Expected `--fcc-expected--` `div` elements, found `--fcc-actual--`.
1515

1616
```js
17-
assert.equal(document.querySelectorAll('.penguin-head > div')?.length, 5);
17+
assert.lengthOf(document.querySelectorAll('.penguin-head > div'), 5);
1818
```
1919

2020
You should give the first new `div` a `class` of `eye`.
@@ -26,7 +26,7 @@ assert.exists(document.querySelector('.penguin-head > div.eye'));
2626
You should give the second new `div` a `class` of `eye`.
2727

2828
```js
29-
assert.equal(document.querySelectorAll('.penguin-head > div.eye')?.length, 2);
29+
assert.lengthOf(document.querySelectorAll('.penguin-head > div.eye'), 2);
3030
```
3131

3232
You should give the first new `div` a `class` of `left`.

curriculum/challenges/english/25-front-end-development/workshop-flappy-penguin/619d0d18ca99870f884a7bff.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ Within each `.eye` element, add a `div` with a `class` of `eye-lid`.
1414
You should add one `div` element within `.eye.left`, but found `--fcc-actual--`.
1515

1616
```js
17-
assert.equal(document.querySelectorAll('.eye.left > div')?.length ?? 0, 1);
17+
assert.lengthOf(document.querySelectorAll('.eye.left > div'), 1);
1818
```
1919

2020
You should add one `div` element within `.eye.right`, but found `--fcc-actual--`.
2121

2222
```js
23-
assert.equal(document.querySelectorAll('.eye.right > div')?.length ?? 0, 1);
23+
assert.lengthOf(document.querySelectorAll('.eye.right > div'), 1);
2424
```
2525

2626
You should give the first new `div` a `class` of `eye-lid`.

0 commit comments

Comments
 (0)