Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

QUALITY ASSURANCE AND TESTING

Nyambati Thomas edited this page Nov 14, 2016 · 5 revisions

Our Teams believes in building quality products, therefore we always ensure that all the features or bug fixes made to this project are well tested.

We have added CI integration to our project to make sure that we achieved a desired (100%) coverage. Any PR that is not well tested will not be merged. Therefore it is important for you to make sure that youR code is well tested before making a PR.

Testing

Our testing environment consists of the following packages and tools:

Our tests are located in the tests folder. We have divided them into two categories:

  • Behaviour
  • Unit

Behaviour

These tests are used to test the behaviour of the module when exposed to different scenarios. This might include no role, no rules etc. These are meant to ensure that this module will provide consistent and accurate response in each given scenario.

context('When config file path is specified', function() {

    it('Should return a map of the ACL rules', function() {
    // test cases
    });

});

Unit.

This are test cases that test individual methods used in this module.

describe('Utils.whenGlobAndActionAllow', function() {
    context('When the Methods are a string', function() {
        it('should call next when method is string and *', function() {
            // test casess
        });
    });
});

What do I need?

To effectively execute local testing, you will be required to install docker client on your local machine. Refer to docker installation guide fo your specific OS.

How do I run the tests?

After installing docler client, You can run tests by running

$ npm run test-dev

This command will buind the docker image and run the tests in it. If you are running this command for the first time it might take a while.

Clone this wiki locally