How to define a Spec in Jasmine?

Pankaj Sharma
Pankaj Sharma

Posted On: Feb 22, 2018

 

spec in Jasmine represents a test case inside the test suite. We can define spec by calling the global Jasmine function it, which, like describe takes a string and a function.

Example

describe("Suite Name", function() {
    it("test spec", function() {
        expect( expression ).toEqual(true);
    }); 
});

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Angularjs unit testing interview questions

    What is angular unit testing?

    Unit testing is a type of software testing where we test individual components of an application. In AngularJS Unit testing is performed using Jasmine and Karma. Jasmine is the testing framework used ...

    Angularjs unit testing interview questions

    What is Karma and Jasmine?

    Karma: Karma is a tool of running tests on browsers it lets us spawn browsers and run jasmine tests inside of them. Jasmine: It is a testing framework for Javascript programming language that support...

    Angularjs unit testing interview questions

    How to install Karma using NPM?

    After installing Node.js, we can install the Karma test runner by running npm install karma --save-dev command....