Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move tests/Unit/js to tests/js #713

Merged
merged 2 commits into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
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