1.0.0 • Published 11 months ago

nanospy v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Nano Spy

A tiny Node.js library to spy and mock methods in tests with great TypeScript support.

It will take only 6 KB in your node_modules and have 0 dependencies.

import { spyOn, restoreAll } from 'nanospy'

test.after.each(() => {
  restoreAll()
})

test('calls increase', () => {
  const spy = spyOn(counter, 'increase')
  counter.increase(5)
  assert.equal(spy.callCount, 1)
  assert.equal(spy.calls, [[5]])
})

Docs

Read full docs here.

1.0.0

11 months ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago