diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..b051c6c57 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +client diff --git a/.eslintrc.json b/.eslintrc.json index a28ebd512..f92aa27b1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -23,6 +23,29 @@ "semi": [ "error", "always" - ] + ], + "no-template-curly-in-string": [1], + "no-unsafe-negation": [1], + "array-callback-return": [1], + "eqeqeq": [2], + "no-eval": [2], + "no-global-assign": [2], + "no-implied-eval": [2], + "no-script-url": [2], + "no-throw-literal": [2], + "yoda": [1], + "no-path-concat": [2], + "no-process-exit": [2], + "camelcase": [1], + "eol-last": [1], + "no-continue": [1], + "no-nested-ternary": [1], + "no-tabs": [2], + "no-unneeded-ternary": [1], + "object-curly-spacing": [1], + "space-infix-ops": ["error"], + "no-const-assign": [2], + "no-duplicate-imports": [2], + "prefer-template": [1] } } diff --git a/package.json b/package.json index 632135005..b7fb48d34 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,25 @@ "description": "A commenting platform from The Coral Project. https://coralproject.net", "main": "app.js", "scripts": { - "lint": "eslint .", "start": "./bin/www", + "lint": "eslint .", + "pretest": "npm install", + "test": "mocha tests", "embed-start": "node client/coral-embed-stream/dev-server.js" }, + "config": { + "pre-git": { + "commit-msg": [], + "pre-commit": [ + "npm run lint" + ], + "pre-push": [ + "npm test" + ], + "post-commit": [], + "post-merge": [] + } + }, "repository": { "type": "git", "url": "git+https://github.com/coralproject/talk.git" @@ -41,11 +56,15 @@ "babel-preset-es2015": "6.13.0", "babel-preset-es2015-minimal": "^2.1.0", "babel-preset-stage-0": "^6.16.0", + "chai": "^3.5.0", "copy-webpack-plugin": "^3.0.1", + "eslint": "^3.9.1", "exports-loader": "^0.6.3", "immutable": "^3.8.1", "imports-loader": "^0.6.5", "json-loader": "^0.5.4", + "mocha": "^3.1.2", + "pre-git": "^3.10.0", "pym.js": "^1.1.1", "react": "15.3.2", "react-dom": "15.3.2", @@ -53,6 +72,7 @@ "redux": "^3.6.0", "redux-thunk": "^2.1.0", "regenerator": "^0.8.46", + "supertest": "^2.0.1", "timeago.js": "^2.0.3", "webpack": "^1.13.2", "webpack-dashboard": "^0.2.0", diff --git a/tests/index.js b/tests/index.js new file mode 100644 index 000000000..0a212b7a4 --- /dev/null +++ b/tests/index.js @@ -0,0 +1,12 @@ +/* eslint-env node, mocha */ +'use strict'; + +const expect = require('chai').expect; + +describe('Comment', () => { + describe.only('#add', () => { + it('should add a comment', () => { + expect(0).to.be.equal(0); + }); + }); +});