浏览代码

Add `test` and `lint` NPM scripts

JC Brand 2 年之前
父节点
当前提交
f2ac748e06
共有 2 个文件被更改,包括 5 次插入4 次删除
  1. 3 4
      Makefile
  2. 2 0
      package.json

+ 3 - 4
Makefile

@@ -3,7 +3,6 @@ BOOTSTRAP		= ./node_modules/
 BUILDDIR		= ./docs
 KARMA			?= ./node_modules/.bin/karma
 CLEANCSS		?= ./node_modules/clean-css-cli/bin/cleancss
-ESLINT			?= ./node_modules/.bin/eslint
 HTTPSERVE	 	?= ./node_modules/.bin/http-server
 HTTPSERVE_PORT	?= 8000
 INKSCAPE		?= inkscape
@@ -218,15 +217,15 @@ types:: node_modules
 
 .PHONY: eslint
 eslint: node_modules
-	$(ESLINT) src/**/*.js
+	npm run lint
 
 .PHONY: check
 check: eslint | dist/converse.js dist/converse.css
-	$(KARMA) start karma.conf.js $(ARGS)
+	npm run test
 
 .PHONY: test
 test:
-	$(KARMA) start karma.conf.js $(ARGS)
+	npm run test
 
 ########################################################################
 ## Documentation

+ 2 - 0
package.json

@@ -28,6 +28,8 @@
   ],
   "scripts": {
     "build": "webpack --config webpack/webpack.build.js",
+    "lint": "eslint src/**/*.js",
+    "test": "karma start karma.conf",
     "cdn": "ASSET_PATH=https://cdn.conversejs.org/dist/ npm run build",
     "clean": "rm -rf node_modules dist *.zip src/headless/dist src/headless/node_modules",
     "dev": "webpack --config webpack/webpack.build.js --mode=development",