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
expect(ioredisMock.once).toBeCalledTimes(2);// If the method was called, it should have called the `once` function twice. If that it the case we can assume that the method was called on creation.
183
183
184
-
// Reset stubs again, we'll check the behaviour calling the method directly.
184
+
// Reset stubs again, we'll check the behavior calling the method directly.
185
185
clearAllMocks();
186
186
expect(ioredisMock.once).not.toBeCalled();// Control assertion
187
187
expect(ioredisMock[METHODS_TO_PROMISE_WRAP[METHODS_TO_PROMISE_WRAP.length-1]]).not.toBeCalled();// Control assertion
expect(fakeImpressionsCache.track.mock.calls[0][0]).toEqual([imp1,imp2,imp3]);// Should call the storage track method once we invoke .track() method, passing queued params in a sequence.
72
+
expect(fakeImpressionsCache.track.mock.calls[0][0]).toEqual([imp1,imp2]);// Should call the storage track method once we invoke .track() method, passing impressions with `track` enabled
81
73
});
82
74
83
75
test('Tracked impressions should be sent to impression listener and integration manager when we invoke .track()',(done)=>{
expect(fakeIntegrationsManager.handleImpression).not.toBeCalled();// The integrations manager handleImpression method should not be invoked if we haven't tracked impressions.
99
91
100
92
// We signal that we actually want to track the queued impressions.
expect(fakeImpressionsCache.track.mock.calls[0][0]).toEqual([fakeImpression,fakeImpression2]);// Even with a listener, impression should be sent to the cache
95
+
expect(fakeImpressionsCache.track.mock.calls[0][0]).toEqual([fakeImpression]);// Even with a listener, impressions (with `track` enabled) should be sent to the cache
104
96
expect(fakeListener.logImpression).not.toBeCalled();// The listener should not be executed synchronously.
105
97
expect(fakeIntegrationsManager.handleImpression).not.toBeCalled();// The integrations manager handleImpression method should not be executed synchronously.
0 commit comments