mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-19 21:09:51 +08:00
fix(curriculum): ensure empty array doesn't pass tests in Quiz Game (#57698)
This commit is contained in:
parent
5077b0e6db
commit
4025aba7a3
@ -43,12 +43,14 @@ questions.forEach(question => {
|
||||
The `category` key should have the value of a string representing a question category.
|
||||
|
||||
```js
|
||||
assert.isNotEmpty(questions);
|
||||
questions.forEach(({category}) => assert.isString(category));
|
||||
```
|
||||
|
||||
The `question` key should have the value of a string representing a question.
|
||||
|
||||
```js
|
||||
assert.isNotEmpty(questions);
|
||||
questions.forEach(({question}) => {
|
||||
assert.isString(question);
|
||||
assert.include(question, '?');
|
||||
@ -58,6 +60,7 @@ questions.forEach(({question}) => {
|
||||
The `choices` key should have the value of an array containing three strings.
|
||||
|
||||
```js
|
||||
assert.isNotEmpty(questions);
|
||||
questions.forEach(({choices}) => {
|
||||
assert.isArray(choices);
|
||||
assert.lengthOf(choices, 3);
|
||||
@ -68,12 +71,14 @@ questions.forEach(({choices}) => {
|
||||
The `answer` key should have the value of a string.
|
||||
|
||||
```js
|
||||
assert.isNotEmpty(questions);
|
||||
questions.forEach(({answer}) => assert.isString(answer));
|
||||
```
|
||||
|
||||
The value of `answer` should be included in the `choices` array.
|
||||
|
||||
```js
|
||||
assert.isNotEmpty(questions);
|
||||
questions.forEach(({answer, choices}) => assert.oneOf(answer, choices));
|
||||
```
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user