diff --git a/.mocharc-min.yml b/.mocharc-min.yml new file mode 100644 index 000000000..e284dff40 --- /dev/null +++ b/.mocharc-min.yml @@ -0,0 +1,6 @@ +recursive: true +ignore: test/filter-tests.js +require: + - esm + - ts-node/register + - source-map-support/register diff --git a/Makefile b/Makefile index 7ac3eca35..752835cf9 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,8 @@ $(NODE_MODULES): package.json | node-installed .PHONY: lint lint: $(NODE_MODULES) ## Checks if the source currently matches code conventions - $(NPM) run ts-compile + $(NPM) run format-check + $(NPM) run ts-check $(NPM) run lint-check .PHONY: lint-fix @@ -55,10 +56,16 @@ test: $(NODE_MODULES) ## Runs the tests $(NPM) run test @echo Tests pass +.PHONY: test-min +test-min: $(NODE_MODULES) ## Runs the minimal tests + $(NPM) run test-min + @echo Tests pass + .PHONY: check -check: $(NODE_MODULES) test lint ## Runs all checks required before committing (fixing trivial things automatically) +check: $(NODE_MODULES) lint test ## Runs all checks required before committing (fixing trivial things automatically) + .PHONY: pre-commit -pre-commit: $(NODE_MODULES) test ci-lint +pre-commit: $(NODE_MODULES) test-min ci-lint .PHONY: clean clean: ## Cleans up everything diff --git a/package.json b/package.json index 55e3fd7e2..da4be4cfe 100644 --- a/package.json +++ b/package.json @@ -158,8 +158,10 @@ "lint": "eslint . --fix", "lint-check": "eslint .", "lint-files": "eslint", - "test": "mocha --recursive", - "check": "npm run lint-check && npm run test -- --reporter min", + "test": "mocha -b", + "test-min": "mocha -b --config .mocharc-min.yml", + "fix": "npm run lint && npm run format && npm run ts-check", + "check": "npm run format-check && npm run ts-check && npm run lint-check && npm run test-min -- --reporter min", "dev": "cross-env NODE_ENV=DEV node -r esm -r ts-node/register app.js", "debugger": "cross-env NODE_ENV=DEV node --inspect -r esm -r ts-node/register app.js --debug", "debug": "cross-env NODE_ENV=DEV node -r esm -r ts-node/register app.js --debug",