Skip to content

Commit

Permalink
fix: WIP on spies
Browse files Browse the repository at this point in the history
A push for @sniperadmin to help on with spies for plain
JavaScript files
  • Loading branch information
BKristenssonAlfsson committed Jun 21, 2020
1 parent 2cf4d7c commit 1d7734e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/unit/remote/peer-fetch.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import PeerFetch from '../../../src/remote/peer-fetch.js'

beforeAll(() => {
jest.spyOn(PeerFetch.prototype, '_drawNewTicket').mockImplementation(() => '12');
});

afterAll(() => {
jest.restoreAllMocks();
});

test('Modify class', () => {
let peer = new PeerFetch();
expect(peer._drawNewTicket()).toBe("12");
});
File renamed without changes.

0 comments on commit 1d7734e

Please sign in to comment.