Skip to content

Commit

Permalink
Merge pull request #713 from owncloud/move-tests-js
Browse files Browse the repository at this point in the history
Move tests/Unit/js to tests/js
  • Loading branch information
Vincent Petry authored Mar 5, 2019
2 parents 062988c + d68d5ac commit 136afa9
Show file tree
Hide file tree
Showing 8 changed files with 2,302 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ node_modules
vendor-bin/**/composer.lock
vendor/
/build/
tests/Unit/js/package-lock.json

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/Unit/js && npm install --deps
cd tests/Unit/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.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/Unit/js/karma.config.js → tests/js/karma.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ module.exports = function(config) {
];

var testFiles = [
'tests/Unit/js/*.js'
'tests/js/*.js'
];

var basePath = '../../../';
var basePath = '../../';
var ownCloudPath = '../../';

var coreModules = require(ownCloudPath + '../../../core/js/core.json');
var coreModules = require(ownCloudPath + '../../core/js/core.json');
var coreLibs = [
ownCloudPath + 'core/js/tests/specHelper.js'
];
Expand Down
File renamed without changes.
Loading

0 comments on commit 136afa9

Please sign in to comment.