Skip to content

Commit

Permalink
Move package.json and standardize test-js in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Mar 4, 2019
1 parent 74197bb commit d68d5ac
Show file tree
Hide file tree
Showing 4 changed files with 2,298 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,5 @@ vendor/
/build/
tests/js/package-lock.json


# php-cs-fixer
.php_cs.cache
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ endif

NODE_PREFIX=$(shell pwd)
BOWER=$(NODE_PREFIX)/node_modules/bower/bin/bower
KARMA=$(NODE_PREFIX)/node_modules/.bin/karma
JSDOC=$(NODE_PREFIX)/node_modules/.bin/jsdoc

app_name=$(notdir $(CURDIR))
Expand All @@ -25,7 +26,7 @@ build_dir=$(CURDIR)/build
dist_dir=$(build_dir)/dist

# dependency folders (leave empty if not required)
nodejs_deps=
nodejs_deps=node_modules
bower_deps=

# composer
Expand Down Expand Up @@ -109,6 +110,16 @@ endif
tar -czf $(dist_dir)/$(app_name).tar.gz -C $(dist_dir) $(app_name)
tar -cjf $(dist_dir)/$(app_name).tar.bz2 -C $(dist_dir) $(app_name)

$(nodejs_deps): package.json yarn.lock
yarn install
touch $@

$(KARMA): $(nodejs_deps)

##------------
## Tests
##------------

.PHONY: test-php-unit
test-php-unit: ## Run php unit tests
test-php-unit: vendor/bin/phpunit
Expand All @@ -120,9 +131,9 @@ test-php-unit-dbg: vendor/bin/phpunit
$(PHPUNITDBG) --configuration ./phpunit.xml --testsuite unit

.PHONY: test-js
test-js:
cd tests/js && npm install --deps
cd tests/js && node_modules/karma/bin/karma start karma.config.js --single-run
test-js: ## Run JavaScript tests
test-js: $(nodejs_deps)
$(KARMA) start tests/js/karma.config.js --single-run

.PHONY: test-php-style
test-php-style: ## Run php-cs-fixer and check owncloud code-style
Expand Down
File renamed without changes.
Loading

0 comments on commit d68d5ac

Please sign in to comment.