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

Commit023c08a

Browse files
committed
changed readme and made some stylistic changes to the code.
2 parents5c7a15c +077e073 commit023c08a

File tree

7 files changed

+2870
-1665
lines changed

7 files changed

+2870
-1665
lines changed

‎.babelrc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["es2015"]
3-
}
2+
"presets": ["env"]
3+
}

‎README.md‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ This repository is to to help you with your `Array.Prototype` chops. The objecti
33

44
##How To
55

6-
Make sure that you`npm install` to get all your dependencies. After you've done that you can run`npm test` to run all of your tests. Alternatively if you have`mocha` installed globally you can simply run`mocha [name of test folder]` and it will run your tests.
7-
8-
Once you get a test to pass make sure you unskip it.
6+
Make sure that you`npm install` to get all your dependencies. After you've done that you can run`npm run test-all` to run all of your tests. Alternatively you can run`npm test [name of test folder]` to run each testing suite individually.

‎filter/filter-test.js‎

Lines changed: 36 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,65 @@
1-
2-
constexpect=require('chai').expect
3-
1+
import'locus'
2+
import{expect}from'chai'
43
describe('filter tests',()=>{
54

6-
it('should pick the even numbers ',()=>{
7-
constnumbers=[1,2,3,4,5,6,7,8,9,10]
8-
expect(results).to.deep.equal([2,4,6,8,10])
5+
it.skip('should pick the even numbers ',()=>{
6+
constnumbers=[1,2,3,4,5,6,7,8,9,10];
7+
8+
expect(results).to.deep.equal([2,4,6,8,10]);
99
});
1010

11-
it('should pick the odd numbers ',()=>{
12-
constnumbers=[1,2,3,4,5,6,7,8,9,10]
11+
it.skip('should pick the odd numbers ',()=>{
12+
constnumbers=[1,2,3,4,5,6,7,8,9,10];
1313

14-
expect(results).to.deep.equal([1,3,5,7,9])
14+
expect(results).to.deep.equal([1,3,5,7,9]);
1515
});
1616

17-
it.skip('should pick words with three characters',()=>{
18-
constwords=["pill","bad","finger","cat","blue","dog","table","red"]
17+
it.skip('should pick words with three characters',()=>{
18+
constwords=["pill","bad","finger","cat","blue","dog","table","red"];
1919

20-
// your code goes here
2120

22-
expect(results).to.deep.equal(["bad","cat","dog","red"])
21+
expect(results).to.deep.equal(["bad","cat","dog","red"]);
2322
});
2423

2524
it.skip('should pick arrays only',()=>{
26-
constelements=["CAT",["dog"],23,[56,3,8],"AIMLESS",43,"butter"]
25+
constelements=["CAT",["dog"],23,[56,3,8],"AIMLESS",43,"butter"];
2726

28-
// your code goes here
2927

30-
expect(results).to.deep.equal([["dog"],[56,3,8]])
28+
expect(results).to.deep.equal([["dog"],[56,3,8]]);
3129
});
3230

3331
it.skip('should remove specific array from object',()=>{
34-
consthuman={name:'yung-jhun',songs:[['cool song 1',50],['cool song 2',100],['cool song 3',90]]}
35-
consttracker={person:human}
36-
constsaying='cool song 2'
37-
38-
// your code goes here.
32+
consthuman={name:'yung-jhun',songs:[['cool song 1',50],['cool song 2',100],['cool song 3',90]]};
33+
constsaying='cool song 2';
3934

40-
expect(human.songs).to.deep.equal([['cool song 1',50],['cool song 3',90]])
35+
expect(human.songs).to.deep.equal([['cool song 1',50],['cool song 3',90]]);
4136
});
4237

4338
it.skip('should filter based off of strings from user ',()=>{
44-
constuserString='su'
45-
constmessages=[{user:'louisa',message:'haaaaa'},
46-
{user:'yung-jhun',message:'kewl dude'},
47-
{user:'alter-nate',message:'suh kewl'},
48-
{user:'meeka',message:'adfasuhlkj'},
49-
{user:'robbie',message:'im super loud'}]
50-
51-
// your code goes here
52-
53-
expect(results).to.deep.equal([{user:'alter-nate',message:'suh kewl'},
54-
{user:'meeka',message:'adfasuhlkj'},
55-
{user:'robbie',message:'im super loud'}])
56-
});
39+
constuserString='su';
40+
constmessages=[{user:'louisa',message:'haaaaa'},
41+
{user:'yung-jhun',message:'kewl dude'},
42+
{user:'alter-nate',message:'suh kewl'},
43+
{user:'meeka',message:'adfasuhlkj'},
44+
{user:'robbie',message:'im super loud'}];
45+
5746

58-
it.skip('should return the correct ids',()=>{
59-
constdata=[{account:'person 1',id:'00112'},
60-
{account:'person 2',id:'00045'},
61-
{account:'person 3',id:'12309'},
62-
{account:'person 4',id:'55931'},
63-
{account:'person 5',id:'90215'}];
47+
expect(results).to.deep.equal([{user:'alter-nate',message:'suh kewl'},
48+
{user:'meeka',message:'adfasuhlkj'},
49+
{user:'robbie',message:'im super loud'}]);
50+
});
6451

65-
constids=['00112','90215','12309']
52+
it.skip('should return the correct ids',()=>{
53+
constdata=[{account:'person 1',id:'00112'},
54+
{account:'person 2',id:'00045'},
55+
{account:'person 3',id:'12309'},
56+
{account:'person 4',id:'55931'},
57+
{account:'person 5',id:'90215'}];
6658

67-
// your code goes here
59+
constids=['00112','90215','12309'];
6860

6961
expect(results).to.deep.equal([{account:'person 1',id:'00112'},
7062
{account:'person 3',id:'12309'},
71-
{account:'person 5',id:'90215'}])
63+
{account:'person 5',id:'90215'}]);
7264
});
73-
7465
});

‎map/map-test.js‎

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,70 @@
1-
require('mocha')
2-
constexpect=require('chai').expect
3-
1+
import'locus'
2+
import{expect}from'chai'
43
describe('map tests',()=>{
54

6-
it('test you can upcase all strings',()=>{
7-
constwords=['meeka','jhun','brenna','steve']
8-
constupperCaseWords=words.map((word)=>word.toUpperCase())
9-
expect(upperCaseWords).to.deep.equal(['MEEKA','JHUN','BRENNA','STEVE'])
10-
})
5+
it.skip('test you can upcase all strings',()=>{
6+
constwords=['meeka','jhun','brenna','steve'];
7+
constupperCaseWords=words.map((word)=>word.toUpperCase());
8+
expect(upperCaseWords).to.deep.equal(['MEEKA','JHUN','BRENNA','STEVE']);
9+
});
1110

1211
it.skip('should allow you to allow you to double numbers',()=>{
13-
constnumbers=[1,2,3,4,5,6]
12+
constnumbers=[1,2,3,4,5,6];
1413

15-
constdoubleNumbers=numbers.map((number)=>{
14+
constdoubleNumbers=numbers.map((number)=>{
1615
// your code goes here
17-
})
16+
});
1817
expect(doubleNumbers).to.deep.equal([2,4,6,8,10,12]);
1918
});
2019

2120
it.skip('should square the numbers',()=>{
22-
constnumbers=[1,2,3,4,5,6]
21+
constnumbers=[1,2,3,4,5,6];
2322

2423
// your code goes here
2524

26-
expect(squareNumbers).to.deep.equal([1,4,9,16,25,36]);
27-
})
25+
expect(squareNumbers).to.deep.equal([1,4,9,16,25,36]);
26+
});
2827

2928
it.skip('should reverse the strings',()=>{
30-
conststrings=["alice","bob","charlie","david","eve"]
29+
conststrings=["alice","bob","charlie","david","eve"];
3130

3231
// your code goes here.
3332

3433
expect(reverseStrings).to
3534
.deep
36-
.equal(["ecila","bob","eilrahc","divad","eve"])
35+
.equal(["ecila","bob","eilrahc","divad","eve"]);
3736
})
3837

39-
it.skip('should add key of swag to every object',()=>{
40-
constarrayOfObjects=[{name:'jhun'},{name:'louisa'}]
38+
it.skip('should add key of swagand value of trueto every object',()=>{
39+
constarrayOfObjects=[{name:'jhun'},{name:'louisa'}];
4140

4241
// your code goes here
4342

44-
expect(newObjects[0].swag).to.deep.equal(true)
45-
expect(newObjects[1].swag).to.deep.equal(true)
43+
expect(newObjects[0].swag).to.deep.equal(true);
44+
expect(newObjects[1].swag).to.deep.equal(true);
4645
})
4746

48-
it.skip('should return an array with the lastconstter of each string',()=>{
49-
constnames=['meeka','jhun','brenna','steve']
47+
it.skip('should return an array with the lastcharacter of each string',()=>{
48+
constnames=['meeka','jhun','brenna','steve'];
5049

5150
// your code goes here
5251

53-
expect(lastLetters).to.deep.equal(['a','n','a','e'])
52+
expect(lastLetters).to.deep.equal(['a','n','a','e']);
5453
});
5554

5655
it.skip('should transform a large object into an array of objects',()=>{
57-
constlargeObject={key1:{name:'jhun',location:'CA'},key2:{name:'brenna',location:'MN'},key3:{name:'louisa',location:'CO'}}
56+
constlargeObject={
57+
key1:{name:'jhun',location:'CA'},
58+
key2:{name:'brenna',location:'MN'},
59+
key3:{name:'louisa',location:'CO'}
60+
}
5861

5962
// your code goes here
60-
expect(array).length.equal(3)
61-
expect(array).to.deep.equal([{id:'key1',name:'jhun',location:'CA'},{id:'key2',name:'brenna',location:'MN'},{id:'key3',name:'louisa',location:'CO'}])
63+
expect(array).length.equal(3);
64+
expect(array).to.deep.equal([
65+
{id:'key1',name:'jhun',location:'CA'},
66+
{id:'key2',name:'brenna',location:'MN'},
67+
{id:'key3',name:'louisa',location:'CO'}
68+
]);
6269
});
6370
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp