What does the “it” function do in this code?

后端 未结 2 1330
一个人的身影
一个人的身影 2021-01-31 14:35

I\'m hoping somebody could explain to me what \"it\" does (is used for) in AngularJS or just plain JavaScript (I\'m not sure if it\'s specific to Angular). This, turns out, is a

2条回答
  •  佛祖请我去吃肉
    2021-01-31 15:29

    See the Jasmine testing framework.

    The it(...) function defines a test case (aka a "spec").

    describe("A suite", function() {
      it("contains spec with an expectation", function() {
        expect(true).toBe(true);
      });
    });
    

    Note that AngularJS E2E Testing...

    ... uses Jasmine for its test syntax.

提交回复
热议问题