This is a custom AngularJS seed project based on grunt the JavaScript task runner.
grunt test:ci
taskDemo: http://lucassus-angular-seed.herokuapp.com
./app
- contains CoffeeScript sources, styles, images, fonts and other assets
./app/scripts
- CoffeeScript sources./app/styles
- stylesheets./app/views
- html templates used by AngularJS./test
- contains tests for the application
./tests/integration
- protractor integration specs./test/e2e
- AngularJS end2end scenarios./tests/unit
- unit tests for AngularJS componentsThird-party libraries
./bower_components
- components dowloaded by bower install
command./custom_components
- you could put custom components here./node_modules
- command dowloaded by npm install
commandGenerated stuff
./dev
- compiled development release./dist
- created by grunt build
command, contains the minified production release of the appInstall nodejs v0.10.12 from the sources:
sudo apt-get install build-essential openssl libssl-dev pkg-config
wget http://nodejs.org/dist/v0.10.12/node-v0.10.12.tar.gz
tar -xzf node-v0.10.12.tar.gz
cd node-v0.10.7
./configure
make
sudo make install
sudo npm install -g grunt-cli
sudo npm install -g nodemon
sudo npm install -g bower
npm install
bower install
script/start-server
Navigate to http://localhost:9000
By default all tests are executed in PhantomJS browser
grunt test:unit
or grunt test
- run unit testsgrunt test:unit:watch
orgrunt test:watch
- run unit tests in watch modegrunt test --coverage-reporter=html
- generate html code coverage reportRun test against specific browsers
grunt test:unit --browsers=Chrome,Firefox,Opera,PhantomJS
script/test-unit
- run unit testsscript/test-integration
- run integration specsnode_modules/protractor/bin/webdriver-manager update
test
evn script/start-test-server
grunt coffee:test && protractor dev/test/protractor-conf.js
phantomjs --webdriver=4444
browserName: "phantomjs"
mocha --compilers coffee:coffee-script --watch --reporter spec server/test
Put debugger
in the failing spec:
describe "Failing spec", ->
it "should run smoothly", ->
debugger # this is like setting a breakpoint
failMiserably()
Run karma in Chrome browser:
grunt test:unit:watch --browsers=Chrome
Run karma directly without CoffeeScript compilation:
karma start test/karma-conf.coffee --single-run
or with auto watch option:
karma start test/karma-conf.coffee
or
karma test:unit:watch
Start Xvfb and export DISPLAY variable:
./script/xvfb start
export DISPLAY=:99
Perform single run:
grunt test --browsers=Firefox,Chrome,Opera,PhantomJS
or
grunt test:watch --browsers=Chrome
script/build
will build the minified production release.
(cd dist/ ; python -m SimpleHTTPServer 8000)
will serve a static assets from ./dist
directory.
Navigate to http://localhost:8000
to see the production release.
git co heroku-production
git merge master
grunt build
git push heroku heroku-production:master -f