Skip to content

Latest commit

 

History

History
116 lines (87 loc) · 4.93 KB

CONTRIBUTING.md

File metadata and controls

116 lines (87 loc) · 4.93 KB

Contributing

All contributions are welcomed!

Opening Issues

Click the below quick links to create a new issue:

Developing

All that is needed to work with this repo is Node.js and your favorite editor or IDE, although we recommend VS Code.

Building

To build and/or work on this project:

Clone the repo, change into the directory where you cloned the directory, and then run the developer setup script

git clone https://github.com/swellaby/azp-bump.git
cd azp-bump 
npm run dev:setup

Submitting changes

Swellaby members should create a branch within the repository, make changes there, and then submit a PR.

Outside contributors should fork the repository, make changes in the fork, and then submit a PR.

git hooks

This repo utilizes the husky module for the git pre-commit hook. As such, when you run a git commit, the pre-commit hook will run a script to ensure the linter still passes, that all tests still pass, and that code coverage is still at 100%. If the script fails your commit will be rejected, and you will need to fix the issue(s) before attempting to commit again.

You can optionally skip this hook by including the -n switch (i.e. git commit -n -m "...") if you are only trying to commit non-code content, like a markdown or package.json file.

Resetting workspace

You may occasionally want and/or need to reset your workspace, especially if you haven't updated your local workspace in a while. To do so, simply run the reset script. This will clean up all generated directories and content, and will also update your local dependencies.

npm run dev:reset

Tests

We use Mocha and Sinon to test and validate, and the tests are written using Mocha's TDD interface.

There are suites of unit tests that validate individual functions in complete isolation, and there are also component tests that use validate multiple components of the module in conjunction. Additionally, there are functional tests in a separate repository here that validate end-to-end functionality of both the CLI and API.

The tests will be run as part of the npm build script and on a git commit, but there are npm scripts you can use to run the test suites directly. The test results will be displayed in the console.

Run the unit tests:

npm run test:unit

Run the component tests:

npm run test:component

Run both unit and component tests:

npm run test:all

You must write corresponding unit and component tests for any code you add or modify, and all tests must pass before those changes can be merged back to the master branch.

Code coverage

Code coverage is generated, and enforced using Istanbuljs/nyc. The unit test suite has 100% coverage of the application source code, and similarly the component test suite also has 100% coverage. Code coverage will not be allowed to dip below 100%.

The tests will be run as part of the npm build script and on a git commit, but there are also several coverage related npm scripts that you can run to generate and/or view the coverage details.

Generate latest coverage for the unit tests:

npm run coverage

Open the detailed HTML coverage report for the unit tests:

npm run coverage:open

Generate latest coverage for the component tests:

npm run coverage:component

Open the detailed HTML coverage report for the component tests:

npm run coverage:component:open

Linting

This repo uses eslint for linting the source code. eslint is automatically run when you run the npm build script and when you make a commit. The eslint configuration file can be found in the [config][config] directory.

You can run eslint at any time by executing the npm lint script:

npm run lint

Back to Top