I wrote this project as a demo project for a talk give titled "TDD in javascript - Not a myth" It was written TDD mode from scracth using yeoman wix-angular generator
This project features:
- Unit testing using jasmine
- Testing http requests and mocking their responses
- E2E testing using protractor
- Using angular ngMockE2E module for writing mock server
- Building mocks for various services
And more..
After you cloned this project, navigate into the project folder and run the following commands in the shell
npm install
bower install
bundle install
grunt serve
- run grunt serve in your root directory of the project
- open
http://localhost:9000
- switch to mobile mode (in chrome dev tools press the mobile icon on the top left corner)
To demonstrate how to work with a server the game call 2 endpoints.
- GET /api/categories
- Returns array of all categories keys
Response Example:
['famousCats', 'capitals', 'movies', 'popes']
- GET /api/categories/{{category}}/words
- Returns array of phrases in that category
Response Example:
['Francis', 'Benedict XVI', 'St John Paul II']
- Package managers:
- Bower
- npm
- Testing:
- karma - test runner
- jasmine - js testing framework
- protractor - e2e tests
- phantomjs - headless browser
- Build tools:
- grunt
- yeoman
Coming soon
For unit tests please see test/spec
folder.
For E2E tests please see test/e2e/spec
folder.
In my talks I gave on NG-NL Conf and AngularJS IL I created a mini-me version of this project. You can check it out here