You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Playing around with Jest, I was delighted with how easy it was to mock out a class and spy on it.
constlogSpy=jest.spyOn(global.console,'log');someComplexFunction();expect(logSpy).toHaveBeenCalled();expect(logSpy).toHaveBeenCalledTimes(2);expect(logSpy).toHaveBeenCalledWith('some important message');expect(logSpy.mock.calls).toContainEqual(['some other message']);logSpy.mockRestore();
I think we should adopt some similar syntax for Pedal, to quickly build up mock functions, classes, methods, and modules. Currently, you have to define new types (types/library/), the Sandbox mocked module, and extensions.
Make this better.
The text was updated successfully, but these errors were encountered:
Playing around with Jest, I was delighted with how easy it was to mock out a class and spy on it.
I think we should adopt some similar syntax for Pedal, to quickly build up mock functions, classes, methods, and modules. Currently, you have to define new types (
types/library/
), the Sandbox mocked module, and extensions.Make this better.
The text was updated successfully, but these errors were encountered: