|
1 | | - |
2 | | -constexpect=require('chai').expect |
3 | | - |
| 1 | +import'locus' |
| 2 | +import{expect}from'chai' |
4 | 3 | describe('filter tests',()=>{ |
5 | 4 |
|
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]); |
9 | 9 | }); |
10 | 10 |
|
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]; |
13 | 13 |
|
14 | | -expect(results).to.deep.equal([1,3,5,7,9]) |
| 14 | +expect(results).to.deep.equal([1,3,5,7,9]); |
15 | 15 | }); |
16 | 16 |
|
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"]; |
19 | 19 |
|
20 | | -// your code goes here |
21 | 20 |
|
22 | | -expect(results).to.deep.equal(["bad","cat","dog","red"]) |
| 21 | +expect(results).to.deep.equal(["bad","cat","dog","red"]); |
23 | 22 | }); |
24 | 23 |
|
25 | 24 | 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"]; |
27 | 26 |
|
28 | | -// your code goes here |
29 | 27 |
|
30 | | -expect(results).to.deep.equal([["dog"],[56,3,8]]) |
| 28 | +expect(results).to.deep.equal([["dog"],[56,3,8]]); |
31 | 29 | }); |
32 | 30 |
|
33 | 31 | 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'; |
39 | 34 |
|
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]]); |
41 | 36 | }); |
42 | 37 |
|
43 | 38 | 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 | + |
57 | 46 |
|
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 | +}); |
64 | 51 |
|
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'}]; |
66 | 58 |
|
67 | | -// your code goes here |
| 59 | +constids=['00112','90215','12309']; |
68 | 60 |
|
69 | 61 | expect(results).to.deep.equal([{account:'person 1',id:'00112'}, |
70 | 62 | {account:'person 3',id:'12309'}, |
71 | | -{account:'person 5',id:'90215'}]) |
| 63 | +{account:'person 5',id:'90215'}]); |
72 | 64 | }); |
73 | | - |
74 | 65 | }); |