-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: #6; add jest and assoc modules * fix: #6; install more test packages, enzyme, jest-cli, etc * fix: #6; basic render test * fix: #6; add config for jest * fix: #6; working child test * fix: #6; test render Favorites * fix: #6; cleanup Child test * fix: #6; basic render test RandomQuestions
- Loading branch information
Showing
6 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// .babelrc | ||
{ | ||
"presets": ["es2015", "react"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//AllQuestions.test.js | ||
|
||
import React from 'react'; | ||
import {shallow} from 'enzyme'; | ||
import AllQuestions from './AllQuestions'; | ||
|
||
test('AllQuestions renders', () => { | ||
const allQuestions = shallow( | ||
<AllQuestions /> | ||
); | ||
|
||
expect(allQuestions).toBeDefined; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//Child.test.js | ||
|
||
import React from 'react'; | ||
import {shallow} from 'enzyme'; | ||
import { MemoryRouter } from 'react-router'; | ||
import Child from './Child'; | ||
|
||
test('Child renders', () => { | ||
const child = shallow( | ||
<MemoryRouter initialEntries={[ '/child/defaultUrl' ]}> | ||
<Child /> | ||
</MemoryRouter> | ||
); | ||
|
||
expect(child).toBeDefined; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//Favorites.test.js | ||
|
||
import React from 'react'; | ||
import {shallow} from 'enzyme'; | ||
import { MemoryRouter } from 'react-router'; | ||
import Favorites from './Favorites'; | ||
|
||
test('Favorites renders', () => { | ||
const favorites = shallow( | ||
<MemoryRouter initialEntries={[ '/favorites' ]}> | ||
<Favorites /> | ||
</MemoryRouter> | ||
); | ||
|
||
expect(favorites).toBeDefined; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//RandomQuestions.test.js | ||
|
||
import React from 'react'; | ||
import {shallow} from 'enzyme'; | ||
import { MemoryRouter } from 'react-router'; | ||
import RandomQuestions from './RandomQuestions'; | ||
|
||
test('RandomQuestions renders', () => { | ||
const randomQuestions = shallow( | ||
<MemoryRouter initialEntries={[ '/random' ]}> | ||
<RandomQuestions /> | ||
</MemoryRouter> | ||
); | ||
|
||
expect(randomQuestions).toBeDefined; | ||
}); |