1.1.2 • Published 3 years ago

jasmine-expect-count v1.1.2

Weekly downloads
33
License
MIT
Repository
github
Last release
3 years ago

Actions Status

Jasmine Expect Count

Lets you specify the number of expects expected to be called.

Installing

Save jasmine-expect-count in devDependencies

npm install jasmine-expect-count --save-dev

then require it

require("jasmine-expect-count");

before your tests.

Using

Jasmine Expect Count allows you to specify the number of expects to be called in an it.

it("should call expect 3 times", function () {
  jasmine.expectCount(3);

  expect(1).toBe(1);

  const p = new Promise(function (resolve) {
    setTimeout(function () {
      expect(2).toBe(2);
      resolve();
    }, 1);
  });

  expect(3).toBe(3);

  // if returning p is forgotten only 2 expects will be called.
  return p;
});
1.1.2

3 years ago

1.1.1

5 years ago

1.1.0

6 years ago

1.0.0

7 years ago