1.1.2 • Published 2 years ago

jasmine-unspy v1.1.2

Weekly downloads
732
License
MIT
Repository
github
Last release
2 years ago

Actions Status

Jasmine Unspy

This will restore the original function to a spy.

Install

npm install --save-dev jasmine-unspy

Using

jasmine.unspy(obj, "method");

Example:

// In your spec helper
require("jasmine-unspy")

// In your specs

describe("jasmine.unspy", function () {
  it("restores a spy", function () {
    let obj = {
      method: _ => true
    };
		spyOn(obj, "method");
    obj.method();
		expect(obj.method).toHaveBeenCalled();
		jasmine.unspy(obj, "method");
		expect(obj.method()).toBe(true);
  });
});
1.1.2

2 years ago

1.1.1

3 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago