Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unlight/jest-createspyobj
Helper function to create spy object for `jest`, same as `jasmine.createSpyObj`
https://github.com/unlight/jest-createspyobj
createspyobj jasmine jest spy
Last synced: about 2 months ago
JSON representation
Helper function to create spy object for `jest`, same as `jasmine.createSpyObj`
- Host: GitHub
- URL: https://github.com/unlight/jest-createspyobj
- Owner: unlight
- License: mit
- Created: 2018-04-03T09:49:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-06T16:38:55.000Z (about 4 years ago)
- Last Synced: 2024-10-04T06:43:53.433Z (3 months ago)
- Topics: createspyobj, jasmine, jest, spy
- Language: JavaScript
- Size: 17.6 KB
- Stars: 7
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# jest-createspyobj
Helper function to create spy object for `jest`, same as `jasmine.createSpyObj`
## USAGE
```ts
import { createSpyObj } from 'jest-createspyobj';class Tape {
play() {}
pause() {}
}const spy1 = createSpyObj('Tape', ['play', 'pause']);
const spy1 = createSpyObj(Tape);
```## API
```ts
function createSpyObj(ref: string, methods: string[]): jest.Mocked;
function createSpyObj(ref: Constructor, methods?: string[]): jest.Mocked;
```