Skip to content

Commit

Permalink
chore(tests): integrate code climate and coveralls
Browse files Browse the repository at this point in the history
- integrate code climate
- integrate coveralls
- add badges
[Finishes #165305220]
  • Loading branch information
jkamz committed May 29, 2019
1 parent 228eeef commit dae79fa
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 24 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*.md]
trim_trailing_whitespace = false

[*.js]
trim_trailing_whitespace = true

# Unix-style newlines with a newline ending every file
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
max_line_length = 100
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.git
/.vscode
/dist
node_modules
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"node": true
},
"extends": "airbnb",
"plugins": ["babel", "import", "jsx-a11y", "react", "prettier"],
"rules": {
"react/prefer-stateless-function": 0,
"react/jsx-filename-extension": [
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ cache:
before-script:
- npm install
script:
- npm test
- npm run test:coveralls
notifications:
slack: andela:Bsl86DcFayVaPuGBjIWfrjI4
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ Create a community of like minded authors to foster inspiration and innovation b

## Badges

[![Build Status](https://travis-ci.org/andela/ah-the-jedi-frontend.svg?branch=develop)](https://travis-ci.org/andela/ah-the-jedi-frontend)
[![Build Status](https://travis-ci.org/andela/ah-the-jedi-frontend.svg?branch=develop)](https://travis-ci.org/andela/ah-the-jedi-frontend) [![Maintainability](https://api.codeclimate.com/v1/badges/48a5a2bb99aab393b44c/maintainability)](https://codeclimate.com/github/andela/ah-the-jedi-frontend/maintainability) [![Coverage Status](https://coveralls.io/repos/github/andela/ah-the-jedi-frontend/badge.svg)](https://coveralls.io/github/andela/ah-the-jedi-frontend)

## Deployment

[Link](https://ah-the-jedi-frontend-staging.herokuapp.com/) to application host on heroku

## Technology Stack
Expand All @@ -25,7 +26,7 @@ Create a community of like minded authors to foster inspiration and innovation b
3. cd into the root of the project directory.
4. Run npm install on the terminal to install dependecies.
5. Setup local development server.
6. To start the application run npm start
6. To start the application run `npm run start:dev`

## Important note:

Expand Down
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"test:watch": "jest --watch",
"test:coverage": "jest --collectCoverage",
"test:coveralls": "jest --coverage --coverageReporters=text-lcov | coveralls",
"heroku-postbuild": "npm run build"
"heroku-postbuild": "npm run build",
"lint": "eslint --debug src/",
"lint:write": "eslint --debug src/ --fix",
"prettier": "prettier --write src/**/*.js"
},
"repository": {
"type": "git",
Expand All @@ -23,7 +26,6 @@
"author": "",
"license": "ISC",
"dependencies": {
"coveralls": "^3.0.3",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.13.2",
"express": "^4.17.1",
Expand All @@ -46,10 +48,14 @@
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"css-loader": "^2.1.1",
"coveralls": "^3.0.3",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-jest-enzyme": "^7.0.2",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.13.0",
"html-webpack-plugin": "^3.2.0",
"identity-obj-proxy": "^3.0.0",
Expand All @@ -60,6 +66,7 @@
"redux-logger": "^3.0.6",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"prettier": "^1.17.1",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.2",
"webpack-dev-server": "^3.4.1"
Expand Down
9 changes: 9 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
printWidth: 100,
singleQuote: true,
trailingComma: 'all',
bracketSpacing: true,
jsxBracketSameLine: false,
tabWidth: 2,
semi: true,
};
16 changes: 9 additions & 7 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const express = require('express')
var app = express();
var path = require('path');
const express = require('express');
const path = require('path');

app.use(express.static("dist"));
app.get('*', (req, res) =>{
res.sendFile(path.resolve(__dirname, "dist", "index.html"));
const port = process.env.PORT || 8080;
const app = express();

app.use(express.static('dist'));
app.get('*', (req, res) => {
res.sendFile(path.resolve(__dirname, 'dist', 'index.html'));
});
app.listen(process.env.PORT || 8080);
app.listen(process.env.PORT || 8080);
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import App from './components/App';
import store from './redux/store';

ReactDOM.render(
<Provider store={ store }>
<App />
</Provider>
, document.getElementById('app'));
<Provider store={store}>
<App />
</Provider>,
document.getElementById('app'),
);
5 changes: 1 addition & 4 deletions src/redux/reducers/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { combineReducers } from 'redux';

const rootReducer = combineReducers ({

})
const rootReducer = combineReducers({});

export default rootReducer;

9 changes: 5 additions & 4 deletions src/redux/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension';
import thunk from 'redux-thunk';
import logger from 'redux-logger';
import rootReducer from '../reducers/'
import rootReducer from '../reducers';

const middlewares = [thunk, logger];

const store = createStore(
rootReducer,
composeWithDevTools(applyMiddleware(...middlewares)));
rootReducer,
composeWithDevTools(applyMiddleware(...middlewares)),
);

export default store
export default store;

0 comments on commit dae79fa

Please sign in to comment.