Skip to content

Instantly share code, notes, and snippets.

@ziazon
Created April 12, 2019 11:33
Show Gist options
  • Save ziazon/4f77643f26863e9a0192ef8b2c642b38 to your computer and use it in GitHub Desktop.
Save ziazon/4f77643f26863e9a0192ef8b2c642b38 to your computer and use it in GitHub Desktop.
Makefile for npm ui projects
.PHONY: help install lint test-unit test-e2e test-e2e-headless
.DEFAULT_GOAL := help
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
install: ## Creates the config.json and install npm dependencies for the project
@echo 'installing Node dependencies'
@npm ci
lint: install ## runs linter
@echo 'running linter'
@npm run lint
test-unit: install ## runs unit tests
@echo 'running unit tests'
@npm run test:unit
test-e2e: install ## runs end to end tests in interactive mode
@echo 'running end to end tests'
@npm run test:e2e
test-e2e-headless: install ## runs end to end tests in headless mode
@echo 'running end to end tests in headless mode'
@npm run test:e2e-headless
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment