Jasmine

By xngo on August 22, 2019

Jasmine is a JavaScript testing framework. It follows the idea of behavior-driven development. It aims to be easy to read. With its build-in matchers, you can literally read the test in full sentence.

For example, to test this function

function helloWorld() {
    return 'Hello world!';
}

you can write the test in Jasmine as:

describe('Hello world', function() {
    it('says hello', function() {
        expect(helloWorld()).toEqual('Hello world!');
    });
});