-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
featA new featureA new feature
Description
Create the code so that you can mock a function like this:
import mockFunction from 'mock-function';
const add = (a: number, b: number) => a + b;
const mockedAdd = mockFunction(add);
mockedAdd.hasBeenCalled();
// ↵ false
mockedAdd(42, 42);
// ↵ 42
mockedAdd(9000, 1);
// ↵ 9001 (😱 OVER 9000)
mockedAdd.hasBeenCalled();
// ↵ true
mockedAdd.hasBeenCalledWith(2000, 12);
// ↵ false
mockedAdd.hasBeenCalledWith(42, 42);
// ↵ true
mockedAdd.calls
// ↵ [[42, 42], [9000, 1]]Metadata
Metadata
Assignees
Labels
featA new featureA new feature