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
As part ofmaintaining a suite of Google App Scripts, we have created a number of mock objects which are loaded into the node environment and allow our tests, and subjects under test, to make use of the Goolge App Script globals - I wondered if gas-local would be a good repository to house them for others to use?
These mocks are simple and provide a mixture of fakes and test-doubles, for example:
One potential problem I can forsee is being strongly opinionated on using Jest for creating mocks; whilst we could remove all calls to jest.fn(); this would put a lot of onus on the test-author to mock out globals in their test, ie:
describe("my suite", () => {
it("should do something...", () => {
// Setup jest mocks
Utilities.formatDate = jest.fn();
});
});
Do let me know if I've missed something; I feel like I'm reinventing the wheel to large extent with implementing all those mocks!
The text was updated successfully, but these errors were encountered:
Thanks for this awesome project 👍
As part ofmaintaining a suite of Google App Scripts, we have created a number of mock objects which are loaded into the node environment and allow our tests, and subjects under test, to make use of the Goolge App Script globals - I wondered if gas-local would be a good repository to house them for others to use?
These mocks are simple and provide a mixture of fakes and test-doubles, for example:
One potential problem I can forsee is being strongly opinionated on using Jest for creating mocks; whilst we could remove all calls to
jest.fn()
; this would put a lot of onus on the test-author to mock out globals in their test, ie:Do let me know if I've missed something; I feel like I'm reinventing the wheel to large extent with implementing all those mocks!
The text was updated successfully, but these errors were encountered: