This file contains hidden or 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
module.exports = { | |
"extends": "airbnb", | |
"rules": { | |
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }] | |
}, | |
}; |
This file contains hidden or 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
import React from 'react'; | |
const App = () => ( | |
<div>My App</div> | |
); | |
export default App; |
This file contains hidden or 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
import React from 'react'; | |
import { shallow } from 'enzyme'; | |
import App from './App'; | |
it('App renders without crashing', () => { | |
const component = shallow(<App />); | |
expect(component.exists()).toEqual(true); | |
}); |
This file contains hidden or 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
{ | |
"files.autoSave": "onWindowChange", | |
"editor.tabSize": 2, | |
"editor.minimap.enabled": true, | |
"window.zoomLevel": 0, | |
"editor.dragAndDrop": true, | |
"html.suggest.html5": true, | |
"files.eol": "\n", | |
"eslint.options": { | |
"extends": "airbnb", |
This file contains hidden or 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
{ | |
"name": "my-react-todolist", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"react": "^15.6.1", | |
"react-dom": "^15.6.1" | |
}, | |
"devDependencies": { | |
"chai": "^4.0.2", |
This file contains hidden or 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
const expect = require('chai').expect; | |
describe('TodoList App', () => { | |
it('Should load with the right title', () => { | |
browser.url('http://localhost:3000/'); | |
const actualTitle = browser.getTitle(); | |
expect(actualTitle).to.eql('Todo List'); | |
}); | |
}); |
This file contains hidden or 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
const expect = require('chai').expect; | |
describe('TodoList App', () => { | |
it('Should load with the right title', () => { | |
... | |
}); | |
it('Should allow me to create a Todo', () => { | |
const todoText = 'Get better at testing'; | |
browser.url('http://localhost:3000/'); |
This file contains hidden or 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
module.exports = { | |
"extends": "airbnb", | |
"rules": { | |
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], | |
"import/no-extraneous-dependencies": [2, { devDependencies: true }], | |
}, | |
}; |
This file contains hidden or 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
import React from 'react'; | |
const AddTodo = () => ( | |
<div /> | |
); | |
export default AddTodo; |
This file contains hidden or 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
/* global expect, it, describe */ | |
import React from 'react'; | |
import { shallow } from 'enzyme'; | |
import AddTodo from '.'; | |
describe('AddTodo component', () => { | |
it('Should render successfully', () => { | |
const component = shallow(<AddTodo />); | |
expect(component.exists()).toEqual(true); |
OlderNewer