Add test and lint NPM scripts

This commit is contained in:
JC Brand 2023-06-02 07:31:47 +02:00
parent 27a47c6ee8
commit f2ac748e06
2 changed files with 5 additions and 4 deletions

View File

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

View File

@ -28,6 +28,8 @@
], ],
"scripts": { "scripts": {
"build": "webpack --config webpack/webpack.build.js", "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", "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", "clean": "rm -rf node_modules dist *.zip src/headless/dist src/headless/node_modules",
"dev": "webpack --config webpack/webpack.build.js --mode=development", "dev": "webpack --config webpack/webpack.build.js --mode=development",