Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit62d30c1

Browse files
committed
formatted tests
1 parentc22c39d commit62d30c1

File tree

2 files changed

+38
-11
lines changed

2 files changed

+38
-11
lines changed

‎filter/filter-test.js‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,41 @@ describe('filter tests', () => {
55
it.skip('should pick the even numbers ',()=>{
66
constnumbers=[1,2,3,4,5,6,7,8,9,10];
77

8+
// your code goes here
9+
810
expect(results).to.deep.equal([2,4,6,8,10]);
911
});
1012

1113
it.skip('should pick the odd numbers ',()=>{
1214
constnumbers=[1,2,3,4,5,6,7,8,9,10];
13-
15+
16+
// your code goes here
17+
1418
expect(results).to.deep.equal([1,3,5,7,9]);
1519
});
1620

1721
it.skip('should pick words with three characters',()=>{
1822
constwords=["pill","bad","finger","cat","blue","dog","table","red"];
1923

20-
24+
// your code goes here
25+
2126
expect(results).to.deep.equal(["bad","cat","dog","red"]);
2227
});
2328

2429
it.skip('should pick arrays only',()=>{
2530
constelements=["CAT",["dog"],23,[56,3,8],"AIMLESS",43,"butter"];
2631

27-
32+
// your code goes here
33+
2834
expect(results).to.deep.equal([["dog"],[56,3,8]]);
2935
});
3036

3137
it.skip('should remove specific array from object',()=>{
3238
consthuman={name:'yung-jhun',songs:[['cool song 1',50],['cool song 2',100],['cool song 3',90]]};
3339
constsaying='cool song 2';
3440

41+
//your code goes here
42+
3543
expect(human.songs).to.deep.equal([['cool song 1',50],['cool song 3',90]]);
3644
});
3745

@@ -43,6 +51,8 @@ describe('filter tests', () => {
4351
{user:'meeka',message:'adfasuhlkj'},
4452
{user:'robbie',message:'im super loud'}];
4553

54+
// your code goes here
55+
4656

4757
expect(results).to.deep.equal([{user:'alter-nate',message:'suh kewl'},
4858
{user:'meeka',message:'adfasuhlkj'},
@@ -58,6 +68,8 @@ describe('filter tests', () => {
5868

5969
constids=['00112','90215','12309'];
6070

71+
// your code goes here
72+
6173
expect(results).to.deep.equal([{account:'person 1',id:'00112'},
6274
{account:'person 3',id:'12309'},
6375
{account:'person 5',id:'90215'}]);

‎reduce/reduce-test.js‎

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,55 +5,70 @@ describe('map tests', () => {
55

66
it.skip('should add all the numbes together',()=>{
77
constnumbers=[32,1,21,5,81,333];
8-
// your code goes here
98

10-
expect(result).to.equal(473)
9+
// your code goes here
10+
11+
expect(result).to.equal(473);
1112
});
1213

1314
it.skip('should subtract all the numbers',()=>{
1415
constnumbers=[28,12,38,1,91];
16+
1517
// your code goes here
18+
1619
expect(results).to.equal(-170);
1720
});
1821

1922
it.skip('should multiply a list of number',()=>{
2023
constnumbers=[2,3,5,7];
21-
//initial value is 1
22-
//Your code goes here
24+
25+
//initial value is 1
26+
//Your code goes here
27+
2328
expect(results).to.equal(210);
2429
});
2530

2631
it.skip('subtrack the smallest number',()=>{
2732
constelements=[[8,5,3],[1,9,11],[4,7,2],[19,34,6]];
33+
2834
// initial value is going to be 100
2935
// your code goes here
36+
3037
expect(results).to.equal(88);
3138
});
3239

3340
it.skip('all second values add together',()=>{
3441
constelements=[["a",1],["b",9],["c",21]];
42+
3543
// initial value is 10
3644
// your code goes here
45+
3746
expect(results).to.equal(31);
3847
});
3948

40-
it.skip('divide 560 by agang of numbers ',()=>{
49+
it.skip('divide 560 by aset of numbers ',()=>{
4150
constnumbers=[2,2,2,5,7];
42-
// inital value is 560
43-
// your code goes here
51+
52+
// inital value is 560
53+
// your code goes here
54+
4455
expect(results).equal(2);
4556
});
4657

4758
it.skip('capitalize keywords in a phrase',()=>{
4859
constkeywords=["fish","blue"];
4960
constsaying='one fish two fish red fish blue fish';
50-
// your code goes here
61+
62+
// your code goes here
63+
5164
expect(results).to.equal('one FISH two FISH red FISH BLUE FISH');
5265
});
5366

5467
it.skip('find smallest key and value inside of the object',()=>{
5568
constarrayOfObjects={a:100,b:200,c:300,d:600};
69+
5670
// your code goes here
71+
5772
expect(smallestValue).to.deep.equal({a:100});
5873
});
5974
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp