jasmine-unspy

1.1.2 • Public • Published

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);
  });
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.2
    29
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.2
    29
  • 1.1.1
    2
  • 1.1.0
    1
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i jasmine-unspy

Weekly Downloads

32

Version

1.1.2

License

MIT

Unpacked Size

10.5 kB

Total Files

12

Last publish

Collaborators

  • tonybrix