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

Commit497ced9

Browse files
committed
outline 6-9 tests
1 parent71070be commit497ced9

File tree

22 files changed

+175
-9
lines changed

22 files changed

+175
-9
lines changed

‎tutorial/06/01.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ describe('01 reducers', () => {
1212
// test must be support future state of reducers
1313
// reducer will be renamed "pokemon", and then
1414
// use combineReducers, which will be hard to track
15-
console.log(reducer);
16-
if(reducer){
15+
if(reducers.toString().match(/=\s?reducer/)){
1716
expect(reducers).to.equal(reducer);
18-
}else{
19-
expect(true).to.be.true;
2017
}
2118
});
2219

‎tutorial/06/02.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
describe('02reducer',()=>{
1+
describe('02"pokemon"',()=>{
22

3-
it('should be renamed "pokemon"',()=>{
4-
expect(reducer).not.to.be.defined;
3+
it('should be the reducer new name',()=>{
54
expect(pokemon).to.be.defined;
5+
expect(typeofpokemon).to.equal('function');
66
});
77

8+
it('should replace the value of "reducers"',()=>{
9+
if(reducers.toString().match(/=\s?reducer/)){
10+
expect(true).to.be.false;
11+
}
12+
})
13+
814
});

‎tutorial/06/04.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
describe('04 reducers',()=>{
22

3-
it('should call "combineReducers" with { pokemon }',()=>{
4-
constregex=/pokemon/;
3+
it('should call "combineReducers"',()=>{
4+
// combineReducers calls a function "combination"
5+
constregex=/functioncombination/;
56
conststring=reducers.toString();
67
expect(string).to.match(regex);
78
});
89

10+
it('should call "combineReducers" with { pokemon }',()=>{
11+
// combineReducers creates a new state with key values
12+
// matching the passed in reducers
13+
constkeys=Object.keys(store.getState());
14+
expect(keys.includes('pokemon')).to.be.true;
15+
});
16+
917
});

‎tutorial/07/01.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
varchai=require('chai');
2+
varspies=require('chai-spies');
3+
varexpect=chai.expect;
4+
chai.use(spies);
5+
6+
varspy=chai.spy.on(console,'log');
7+
8+
/// load('index.js')
9+
10+
describe('01 applyMiddleware',()=>{
11+
12+
it('should be imported',()=>{
13+
expect(applyMiddleware).to.be.defined;
14+
});
15+
16+
});

‎tutorial/07/02.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
describe('02 createStore',()=>{
2+
3+
it('should call applyMiddleware',()=>{
4+
5+
});
6+
7+
});

‎tutorial/07/03.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
describe('03 redux-logger')
2+
3+
it('should be installed. `npm i -D redux-logger`',()=>{
4+
expect(exists('node_modules/redux-logger')).to.be.true;
5+
});
6+
7+
});

‎tutorial/07/04.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
describe('04 logger',()=>{
2+
3+
it('doesn\'t exist',()=>{
4+
expect(logger).to.be.defined;
5+
});
6+
7+
it('should be set to `createLogger()`',()=>{
8+
9+
});
10+
11+
});

‎tutorial/07/05.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
describe('05 applyMiddleware logger',()=>{
2+
3+
it('',()=>{
4+
5+
});
6+
7+
});

‎tutorial/08/01.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
varchai=require('chai');
2+
varspies=require('chai-spies');
3+
varexpect=chai.expect;
4+
chai.use(spies);
5+
6+
varspy=chai.spy.on(console,'log');
7+
8+
/// load('index.js')
9+
10+
describe('01 SORT_BY_POPULARITY action type',()=>{
11+
12+
it('doesn\'t exist',()=>{
13+
expect(SORT_BY_POPULARITY).to.be.defined;
14+
});
15+
16+
it('should equal the string "SORT_BY_POPULARITY"',()=>{
17+
expect(SORT_BY_POPULARITY).to.equal('SORT_BY_POPULARITY');
18+
});
19+
20+
});

‎tutorial/08/02.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
describe('02 sortByPopularity action creator',()=>{
2+
3+
it('doesn\'t exist',()=>{
4+
expect(sortByPopularity).to.be.defined;
5+
});
6+
7+
it('should equal the string "SORT_BY_POPULARITY"',()=>{
8+
expect(sortByPopularity()).to.equal({type:'SORT_BY_POPULARITY'});
9+
});
10+
11+
});

‎tutorial/08/03.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('03 dispatch sortByPopularity action',()=>{
2+
3+
4+
5+
});

‎tutorial/08/04.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('04 SORT_BY_POPULARITY reducer case',()=>{
2+
3+
4+
5+
});

‎tutorial/08/05.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('05 sortByVotes function',()=>{
2+
3+
4+
5+
});

‎tutorial/08/06.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('06 sortByKey function',()=>{
2+
3+
4+
5+
});

‎tutorial/08/07.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('07 sorted pokemon',()=>{
2+
3+
4+
5+
});

‎tutorial/08/08.js

Whitespace-only changes.

‎tutorial/09/01.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
varchai=require('chai');
2+
varspies=require('chai-spies');
3+
varexpect=chai.expect;
4+
chai.use(spies);
5+
6+
varspy=chai.spy.on(console,'log');
7+
8+
/// load('index.js')
9+
10+
describe('01 redux thunk',()=>{
11+
12+
it('should be installed',()=>{
13+
expect(exist('node_modules/redux-thunk').to.be.true;
14+
});
15+
16+
});

‎tutorial/09/02.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
describe('02 thunk',()=>{
2+
3+
it('should be imported',()=>{
4+
expect(thunk).to.be.defined;
5+
});
6+
7+
// more specific check
8+
9+
});

‎tutorial/09/03.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('03 applyMiddleware thunk',()=>{
2+
3+
4+
5+
});

‎tutorial/09/04.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
describe('04 voteUp',()=>{
2+
3+
it('should return a thunk with a "dispatch" param',()=>{
4+
5+
});
6+
7+
});

‎tutorial/09/05.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
describe('05 voteUp',()=>{
2+
3+
it('should dispatch a VOTE_UP action',()=>{
4+
5+
});
6+
7+
});

‎tutorial/09/06.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
describe('06 voteUp',()=>{
2+
3+
it('should dispatch a SORT_BY_POPULARITY action',()=>{
4+
5+
});
6+
7+
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp