mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
fix(curriculum): added test case and resorted tests for arguments-optional page (#50404)
* fix: added test case and resorted tests * fix: added test case and resorted tests * updated test cases to match issue
This commit is contained in:
+30
-24
@@ -36,30 +36,6 @@ assert.deepEqual(addTogether(2, 3), 5);
|
||||
assert.deepEqual(addTogether(23, 30), 53);
|
||||
```
|
||||
|
||||
`addTogether(5)(7)` should return 12.
|
||||
|
||||
```js
|
||||
assert.deepEqual(addTogether(5)(7), 12);
|
||||
```
|
||||
|
||||
`addTogether("https://www.youtube.com/watch?v=dQw4w9WgXcQ")` should return `undefined`.
|
||||
|
||||
```js
|
||||
assert.isUndefined(addTogether('https://www.youtube.com/watch?v=dQw4w9WgXcQ'));
|
||||
```
|
||||
|
||||
`addTogether(2, "3")` should return `undefined`.
|
||||
|
||||
```js
|
||||
assert.isUndefined(addTogether(2, '3'));
|
||||
```
|
||||
|
||||
`addTogether(2)([3])` should return `undefined`.
|
||||
|
||||
```js
|
||||
assert.isUndefined(addTogether(2)([3]));
|
||||
```
|
||||
|
||||
`addTogether("2", 3)` should return `undefined`.
|
||||
|
||||
```js
|
||||
@@ -72,6 +48,36 @@ assert.isUndefined(addTogether('2', 3));
|
||||
assert.isUndefined(addTogether(5, undefined));
|
||||
```
|
||||
|
||||
`addTogether("https://www.youtube.com/watch?v=dQw4w9WgXcQ")` should return `undefined`.
|
||||
|
||||
```js
|
||||
assert.isUndefined(addTogether('https://www.youtube.com/watch?v=dQw4w9WgXcQ'));
|
||||
```
|
||||
|
||||
`addTogether(5)` should return a function.
|
||||
|
||||
```js
|
||||
assert.deepEqual(typeof(addTogether(5)), 'function');
|
||||
```
|
||||
|
||||
`addTogether(5)(7)` should return 12.
|
||||
|
||||
```js
|
||||
assert.deepEqual(addTogether(5)(7), 12);
|
||||
```
|
||||
|
||||
`addTogether(2)([3])` should return `undefined`.
|
||||
|
||||
```js
|
||||
assert.isUndefined(addTogether(2)([3]));
|
||||
```
|
||||
|
||||
`addTogether(2, "3")` should return `undefined`.
|
||||
|
||||
```js
|
||||
assert.isUndefined(addTogether(2, '3'));
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
Reference in New Issue
Block a user