Skip to content

Instantly share code, notes, and snippets.

View sanjsanj's full-sized avatar

Sanjay Purswani sanjsanj

View GitHub Profile
module.exports = {
"extends": "airbnb",
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
},
};
import React from 'react';
const App = () => (
<div>My App</div>
);
export default App;
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);
});
{
"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",
{
"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",
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');
});
});
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/');
module.exports = {
"extends": "airbnb",
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"import/no-extraneous-dependencies": [2, { devDependencies: true }],
},
};
import React from 'react';
const AddTodo = () => (
<div />
);
export default AddTodo;
/* 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);