Skip to content

Commit

Permalink
Make check and npm run check now run similar steps (#3722)
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenRBS committed May 27, 2022
1 parent c42ec3b commit e98d428
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .mocharc-min.yml
@@ -0,0 +1,6 @@
recursive: true
ignore: test/filter-tests.js
require:
- esm
- ts-node/register
- source-map-support/register
13 changes: 10 additions & 3 deletions Makefile
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions package.json
Expand Up @@ -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",
Expand Down

0 comments on commit e98d428

Please sign in to comment.