mirror of
https://github.com/chylex/Nextcloud-News.git
synced 2025-04-10 13:15:42 +02:00
.. | ||
app | ||
build | ||
controller | ||
directive | ||
gui | ||
service | ||
tests | ||
utility | ||
vendor | ||
.bowerrc | ||
.jshintrc | ||
bower.json | ||
Gruntfile.js | ||
karma.conf.js | ||
package.json | ||
protractor.chrome.conf.js | ||
protractor.phantomjs.conf.js | ||
README.md |
JavaScript Development
Before starting, install nodejs 0.10 and grunt-cli:
sudo npm -g install grunt-cli
then run:
npm install
The news app uses Traceur to transpile ES6 into ES5. If you want to take a look at the features see the language features reference.
Iterators
The following iterators are defined and availabe:
-
items:
// iterate over object key and value for (let [key, value] of items(obj)) { console.log(`object key: ${key}, object value: ${value}`) }
-
enumerate:
// iterate over list and get the index and value for (let [index, value] of enumerate(list)) { console.log(`at position: ${index}, value is: ${value}`) }
-
reverse:
// iterate over list in reverse order for (let value of reverse(list)) { console.log(`value is: ${value}`) }
Building
Watch mode:
grunt dev
Single run mode:
grunt
Testing
Watch mode:
grunt php
grunt test
Single run mode:
grunt phpunit
grunt ci-unit
Running e2e tests
Install protractor and set up selenium:
sudo npm install -g protractor
sudo webdriver-manager update
then the tests can be started with:
grunt e2e