3.0 KiB
Contributing to angular-breadcrumb
I am very glad to see this project living with PR from contributors who trust in it. Here is some guidelines to keep the contributions useful and efficient.
Development hints
Installation
- Checkout the repository
- Run
npm install - Run
bower install
Test running
This module uses the classic AngularJS stack with:
- Karma (test runner)
- Jasmine (assertion framework)
- angular-mocks (AngularJS module for testing)
Run the test with the grunt task grunt test. It runs the tests with different versions of AngularJS.
Test developing
Tests are build around modules with a specific $stateProvider configuration:
- Basic configuration: Basic definitions (no template, no controller)
- Interpolation configuration: States with bindings in
ncyBreadcrumbLabel - HTML configuration: States with HTML in
ncyBreadcrumbLabel - Sample configuration: Bridge towards the sample app configuration for using in tests
- UI-router's configuration: Clone of the UI-router sample app (complemented with breadcrumb configuration)
Theses modules are loaded by Karma and they are available in test specifications.
Specifications are generally related to the directive ncyBreadcrumb or the service $breadcrumb.
Sample
If you are not familiar with JS testing. You can run the sample locally for testing purposes by using grunt sample. Sources are live-reloaded after each changes.
Submitting a Pull Request
- Fork the repository
- Make your changes in a new git branch following the coding rules below.
- Run the grunt default task (by typing
gruntorgrunt default): it will run the tests and build the module indistdirectory) - Commit the changes (including the
distdirectory) by using the commit conventions explained below. - Push and make the PR
Coding rules
- When making changes on the source file, please check that your changes are covered by the tests. If not, create a new test case.
Commit conventions
angular-breadcrumb uses the same strict conventions as AngularJS and UI-router. These conventions are explained here.
It is very important to fit these conventions especially for types fix and feature which are used by the CHANGELOG.md generation (it uses the grunt-conventional-changelog).