Jasmine2: get current spec name

前端 未结 6 697
天涯浪人
天涯浪人 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条回答
  •  独厮守ぢ
    2020-12-15 20:37

    This is probably a bit late but you can get the suite name outside the spec. Please try the following code:

      describe("name for describe", function () {
        console.log(this.getFullName()); // would print "name for describe"
        it("name for it", function () {
          //Your test spec
        });
      });
    

提交回复
热议问题