Skip to content

Commit

Permalink
Configure linting & add unit tests (#28)
Browse files Browse the repository at this point in the history
* Add vscode to gitignore

* Set up linting and testing

Co-authored-by: Daniel Leu <[email protected]>
  • Loading branch information
monostere0 and Daniel Leu authored Feb 26, 2021
1 parent 40e51b4 commit 3ac24f5
Show file tree
Hide file tree
Showing 9 changed files with 3,953 additions and 694 deletions.
30 changes: 30 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"env": {
"browser": true,
"commonjs": true,
"node": true,
"es6": true,
"mocha": true,
"jest": true
},
"plugins": ["jest"],
"globals": {
"console": "readonly",
"process": "readonly"
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2017
},
"rules": {
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"eol-last": ["error", "always"],
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn"
}
}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,6 @@ dist
.yarn/install-state.gz
.pnp.*

.DS_Store
.DS_Store

.vscode
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Serverless Framework plugin for WSO2 API Manager",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "jest",
"lint": "eslint .",
"release:alpha": "release pre alpha",
"release:patch": "release patch",
"release:minor": "release minor",
Expand All @@ -27,9 +28,12 @@
],
"devDependencies": {
"axios": "^0.21.1",
"eslint": "^7.20.0",
"eslint-plugin-jest": "^24.1.5",
"form-data": "^3.0.0",
"fs": "^0.0.1-security",
"https": "^1.0.0",
"jest": "^26.6.3",
"qs": "^6.9.4",
"release": "^6.3.0",
"serverless": "^1.75.1",
Expand Down
Loading

0 comments on commit 3ac24f5

Please sign in to comment.