The 'describe' keyword in javascript

Aatish Molasi picture Aatish Molasi · Aug 31, 2012 · Viewed 57.1k times · Source

So I am a newbie in javascript and i had been going through some one else's code and I found this..

describe('deviceready', function() {
    it('should report that it fired', function() {
        spyOn(app, 'report');
        app.deviceready();
        expect(app.report).toHaveBeenCalledWith('deviceready');
    });
});

What I don't understand is: What exactly does the describe keyword do?

info:
- Its a phonegap application
- We are using the spine.js and jQuery libraries

Answer

mmigdol picture mmigdol · Aug 31, 2012

Describe is a function in the Jasmine testing framework. It simply describes the suite of test cases enumerated by the "it" functions.

Also used in the mochajs framework.