# jasmine-unspy

> Reset a spy to the original function

Latest version **1.1.2** (published 2022-01-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install jasmine-unspy
pnpm add jasmine-unspy
yarn add jasmine-unspy
bun add jasmine-unspy
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2022-01-03 |
| First published | 2017-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tony Brix |
| Maintainers | tonybrix |
| Keywords | jasmine, unspy |

## Links

- npm: https://www.npmjs.com/package/jasmine-unspy
- Repository: https://github.com/UziTech/jasmine-unspy
- Homepage: https://github.com/UziTech/jasmine-unspy#readme
- Issues: https://github.com/UziTech/jasmine-unspy/issues
- npm.io page: https://npm.io/package/jasmine-unspy

## Alternatives

- [pagerjs](https://npm.io/package/pagerjs.md) — 60 weekly downloads
- [whistle.savefor-mock](https://npm.io/package/whistle.savefor-mock.md) — 4 weekly downloads
- [avis2-design-system](https://npm.io/package/avis2-design-system.md) — 0 weekly downloads
- [@ir-kit/openapi-ts-faker](https://npm.io/package/@ir-kit/openapi-ts-faker.md) — 0 weekly downloads
- [@apigit/mock-engine](https://npm.io/package/@apigit/mock-engine.md) — 0 weekly downloads

## Recent versions

- 1.1.2 (latest) — 2022-01-03
- 1.1.1 — 2020-11-29
- 1.1.0 — 2018-02-07
- 1.0.1 — 2018-01-10
- 1.0.0 — 2017-03-18

## README

[![Actions Status](https://github.com/UziTech/jasmine-unspy/workflows/CI/badge.svg)](https://github.com/UziTech/jasmine-unspy/actions)

# Jasmine Unspy

This will restore the original function to a spy.

## Install

```sh
npm install --save-dev jasmine-unspy
```

## Using

```js
jasmine.unspy(obj, "method");
```

### Example:

```js
// 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);
  });
});
```

---
_Source: https://npm.io/package/jasmine-unspy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
