What does the `it ()` function do here?

The following code snippet is the corner documentation . What is the function here it()(I assume that it has some kind of conditional value, because otherwise it makes no sense)? I do not see any links to it on the corner site. It is also difficult for Google because of its name. The context concerns code testing.

it('should say hello', function() {
  var scopeMock = {};
  var cntl = new MyController(scopeMock);

  // Assert that username is pre-filled
  expect(scopeMock.username).toEqual('World');

  // Assert that we read new username and greet
  scopeMock.username = 'angular';
  scopeMock.sayHello();
  expect(scopeMock.greeting).toEqual('Hello angular!');
});
+9
source share
2 answers

it() , . , ( ), , .

it() . , , . it() , , , expect(). expect() , .

- : http://jasmine.imtqy.com/

+14

All Articles