Jasmine2: get current spec name

前端 未结 6 700
天涯浪人
天涯浪人 2020-12-15 19:34

In Jasmine 1.3, we had this option to the get current spec and suite names:

describe(\"name for describe\", function () {
    it(\"name for it\", function ()         


        
6条回答
  •  萌比男神i
    2020-12-15 20:28

        var currentSpecName = describe('Test1', function() {
            var currentStepName = it("Step1", function(){
               console.log(currentStepName.description); // Prints It Name
               console.log(currentSpecName.getFullName()); //Prints Describe Name
            });
        });
    

提交回复
热议问题