Any way to provide a mind for disabled people in Jasmine

Currently, we can indicate the reason for waiting for the specification using the function pend()in this way -

xit("pending spec", function(){
    //Skipped spec
}).pend("This is a reason");

The output of the specified function will be -

Sample Test: pending spec
This is a reason
Executed 1 of 1 specs (1 PENDING)

Now, how to get the same reason for disconnected packages?

xdescribe('Disabled suite' , function(){
    it('example spec', function(){
        //example
    });
}).pend("This is a reason");

The output of the disconnected package above is

No reason given

and stays the same even if I use the function pend(). Thank!

+4
source share
1 answer

A pending message is not implemented in the package, but you can override the method pendto force it to write a message for each specification:

jasmine.Suite.prototype.pend = function(message){
    this.markedPending = true;
    this.children.forEach(spec => spec.pend(message));
};

Using:

xdescribe('Suite', function() {


}).pend("Feature not yet implemented");

Suite.js:

https://github.com/jasmine/jasmine/blob/master/src/core/Suite.js#L45

+2

All Articles