From f2ac748e06062747ba190e211398de3b7079be10 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Fri, 2 Jun 2023 07:31:47 +0200 Subject: [PATCH] Add `test` and `lint` NPM scripts --- Makefile | 7 +++---- package.json | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 780857c10..bfbaaab28 100644 --- a/Makefile +++ b/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 diff --git a/package.json b/package.json index 24332846c..9273140db 100644 --- a/package.json +++ b/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",