Skip to content

Commit

Permalink
new app and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Evheniy Bystrov committed Feb 10, 2017
1 parent 3d35b37 commit db0961c
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 56 deletions.
42 changes: 3 additions & 39 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,52 +1,16 @@
{
"parser": "babel-eslint",
"extends": "airbnb",
"env": {
"browser": true,
"node": true,
"mocha": true
},
"globals": {
"connect": true,
"__CLIENT__": true,
"__DOMAIN__": true,
"__DEVELOPMENT__": true,
"__PRODUCTION__": true,
"expect": true,
"require": true

},
"rules": {
"indent": ["error", 4, {"SwitchCase": 1}],
"react/jsx-indent": ["error", 4],
"react/jsx-indent-props": ["error", 4],
"react/jsx-filename-extension": 0,
"no-useless-computed-key": 0,
"no-unused-vars": 0,
"no-underscore-dangle": 0,
"global-require": 0,
"no-useless-escape": 0,
"max-len": 0,
"no-console": 0,
"no-unused-expressions": 0,
"no-param-reassign": 0,
"no-unneeded-ternary": 0,
"arrow-body-style": 0,
"react/jsx-no-bind": 0,
"default-case": 0,
"prefer-template": 0,
"padded-blocks": 0,
"camelcase": 0,
"no-else-return": 0,
"func-names": 0,
"consistent-return": 0,
"array-callback-return": 0,
"no-confusing-arrow": 0,
"no-case-declaration": 0,
"react/jsx-closing-bracket-location": 0,
"react/react-in-jsx-scope": 0,
"no-empty": 0,
"react/prefer-stateless-function": 0,
"no-nested-ternary": 0,
"no-did-update-set-state": 0
"indent": ["error", 4, {"SwitchCase": 1}]
},
"plugins": [
"react"
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ coverage
.idea
npm-debug.log
node_modules
.DS_Store
.DS_Store
dist
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
language: node_js
node_js:
- 7
- "4"
- "5"
- "6"
script:
- npm test && npm run coverage:report
- npm run lint
- npm run test
- npm run report
Empty file removed docs/.gitkeep
Empty file.
File renamed without changes.
25 changes: 18 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"description": "React static site generator",
"main": "index.js",
"scripts": {
"test": "npm run security && npm run clear && npm run lint && npm run coverage",
"test:watch": "npm run test -- --watch",
"lint": "./node_modules/.bin/eslint .",
"coverage": "./node_modules/.bin/babel-node node_modules/.bin/babel-istanbul cover ./node_modules/.bin/_mocha -- tests --recursive",
"coverage:report": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls",
"clear": "./node_modules/.bin/rimraf coverage",
"security": "./node_modules/.bin/nsp check"
"clear": "./node_modules/.bin/rimraf coverage dist",
"lint": "./node_modules/.bin/npm-run-all lint:**",
"lint:js": "./node_modules/.bin/eslint src tests",
"test": "./node_modules/.bin/npm-run-all test:**",
"test:security": "./node_modules/.bin/nsp check",
"test:coverage": "./node_modules/.bin/babel-node node_modules/.bin/babel-istanbul cover ./node_modules/.bin/_mocha -- tests/**/*.{js,jsx}",
"report": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls"
},
"engines": {
"node": ">=7.0.0"
Expand Down Expand Up @@ -43,7 +43,12 @@
"immutable": "^3.8.1",
"koa": "^2.0.0-alpha.7",
"koa-router": "^7.0.1",
"npm-run-all": "^4.0.1",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-redux": "^5.0.2",
"react-router": "^3.0.2",
"react-router-redux": "^4.0.7",
"redux": "^3.6.0",
"webpack": "^2.2.1"
},
Expand All @@ -55,12 +60,18 @@
"chai-immutable": "^1.6.0",
"coveralls": "^2.11.15",
"debug": "^2.6.0",
"enzyme": "^2.7.1",
"eslint": "^3.14.1",
"eslint-config-airbnb": "^14.1.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.9.0",
"istanbul": "^1.1.0-alpha.1",
"jsdom": "^9.10.0",
"mocha": "^3.2.0",
"mocha-lcov-reporter": "^1.2.0",
"nsp": "^2.6.2",
"react-addons-test-utils": "^15.4.2",
"rimraf": "^2.5.4",
"sinon": "^1.17.7",
"sinon-chai": "^2.8.0"
Expand Down
Empty file removed src/app/index.js
Empty file.
11 changes: 11 additions & 0 deletions src/app/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';

/* export default () => {
ReactDOM.render(
<h1>Test</h1>,
document.getElementById('root')
);
} */

export default () => <div><h1>Test</h1></div>;
7 changes: 0 additions & 7 deletions tests/app/index.js

This file was deleted.

11 changes: 11 additions & 0 deletions tests/app/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import { shallow } from 'enzyme';
import { expect } from 'chai';
import App from '../../src/app/index';

describe('Test app', () => {
it('should test app', () => {
const wrapper = shallow(<App />);
expect(wrapper.contains(<h1>Test</h1>)).to.equal(true);
});
});

0 comments on commit db0961c

Please sign in to comment.