Each resource must be tested in complete isolation from the rest of the world. All dependencies should be mocked, e.g. when testing a component, we should not relay at all on any injected services.
- Component with a custom service dependency.
- Custom service with Angular service dependency.
- Custom service, dependent on another custom service and an Angular service.
- Filter.
git clone https://github.com/vmanchev/angularjs-unit-test.git
sudo apt-get install node
sudo npm install -g karma-cli
//it will also run bower install and gulp for you
npm install
npm start
npm test
npm run testing
Find the code coverage in the ./coverage folder. Just run the index.html file in a browser.
- Install protractor and webdriver
npm install -g protractor
- Install JRE if you don't have it
sudo apt install default-jre
- Start the webdriver server
webdriver-manager start
- Start the application in new terminal tab
npm start
- Run protractor
protractor e2e-tests/protractor.conf.js