Wondering what‚Äôs next for npm?Check out our public roadmap! ¬Ľ

    jasmine-unspy

    1.1.1¬†‚Äʬ†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);
      });
    });

    Keywords

    Install

    npm i jasmine-unspy

    DownloadsWeekly Downloads

    1,699

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    10.2 kB

    Total Files

    12

    Last publish

    Collaborators

    • avatar