@walkeros/collector 0.6.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -3
- package/dist/index.d.mts +12 -7
- package/dist/index.d.ts +12 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/__tests__/auto-run.test.d.ts +0 -2
- package/dist/__tests__/auto-run.test.d.ts.map +0 -1
- package/dist/__tests__/auto-run.test.js +0 -102
- package/dist/__tests__/auto-run.test.js.map +0 -1
- package/dist/__tests__/consent.test.d.ts +0 -2
- package/dist/__tests__/consent.test.d.ts.map +0 -1
- package/dist/__tests__/consent.test.js +0 -21
- package/dist/__tests__/consent.test.js.map +0 -1
- package/dist/__tests__/create-flow.test.d.ts +0 -2
- package/dist/__tests__/create-flow.test.d.ts.map +0 -1
- package/dist/__tests__/create-flow.test.js +0 -69
- package/dist/__tests__/create-flow.test.js.map +0 -1
- package/dist/__tests__/destination-code.test.d.ts +0 -2
- package/dist/__tests__/destination-code.test.d.ts.map +0 -1
- package/dist/__tests__/destination-code.test.js +0 -396
- package/dist/__tests__/destination-code.test.js.map +0 -1
- package/dist/__tests__/destination.test.d.ts +0 -2
- package/dist/__tests__/destination.test.d.ts.map +0 -1
- package/dist/__tests__/destination.test.js +0 -471
- package/dist/__tests__/destination.test.js.map +0 -1
- package/dist/__tests__/handle.test.d.ts +0 -2
- package/dist/__tests__/handle.test.d.ts.map +0 -1
- package/dist/__tests__/handle.test.js +0 -78
- package/dist/__tests__/handle.test.js.map +0 -1
- package/dist/__tests__/mapping.test.d.ts +0 -2
- package/dist/__tests__/mapping.test.d.ts.map +0 -1
- package/dist/__tests__/mapping.test.js +0 -310
- package/dist/__tests__/mapping.test.js.map +0 -1
- package/dist/__tests__/source.test.d.ts +0 -2
- package/dist/__tests__/source.test.d.ts.map +0 -1
- package/dist/__tests__/source.test.js +0 -306
- package/dist/__tests__/source.test.js.map +0 -1
- package/dist/__tests__/start-flow.test.d.ts +0 -2
- package/dist/__tests__/start-flow.test.d.ts.map +0 -1
- package/dist/__tests__/start-flow.test.js +0 -167
- package/dist/__tests__/start-flow.test.js.map +0 -1
- package/dist/__tests__/walker-entity.test.d.ts +0 -2
- package/dist/__tests__/walker-entity.test.d.ts.map +0 -1
- package/dist/__tests__/walker-entity.test.js +0 -52
- package/dist/__tests__/walker-entity.test.js.map +0 -1
- package/dist/collector.d.ts +0 -3
- package/dist/collector.d.ts.map +0 -1
- package/dist/collector.js +0 -60
- package/dist/collector.js.map +0 -1
- package/dist/command.d.ts +0 -12
- package/dist/command.d.ts.map +0 -1
- package/dist/command.js +0 -20
- package/dist/command.js.map +0 -1
- package/dist/consent.d.ts +0 -10
- package/dist/consent.d.ts.map +0 -1
- package/dist/consent.js +0 -30
- package/dist/consent.js.map +0 -1
- package/dist/constants.d.ts +0 -13
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -35
- package/dist/constants.js.map +0 -1
- package/dist/destination-code.d.ts +0 -4
- package/dist/destination-code.d.ts.map +0 -1
- package/dist/destination-code.js +0 -72
- package/dist/destination-code.js.map +0 -1
- package/dist/destination.d.ts +0 -61
- package/dist/destination.d.ts.map +0 -1
- package/dist/destination.js +0 -325
- package/dist/destination.js.map +0 -1
- package/dist/dev.d.ts.map +0 -1
- package/dist/elb.d.ts +0 -11
- package/dist/elb.d.ts.map +0 -1
- package/dist/elb.js +0 -60
- package/dist/elb.js.map +0 -1
- package/dist/flow.d.ts +0 -4
- package/dist/flow.d.ts.map +0 -1
- package/dist/flow.js +0 -44
- package/dist/flow.js.map +0 -1
- package/dist/handle.d.ts +0 -29
- package/dist/handle.d.ts.map +0 -1
- package/dist/handle.js +0 -161
- package/dist/handle.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/on.d.ts +0 -19
- package/dist/on.d.ts.map +0 -1
- package/dist/on.js +0 -127
- package/dist/on.js.map +0 -1
- package/dist/push.d.ts +0 -11
- package/dist/push.d.ts.map +0 -1
- package/dist/push.js +0 -43
- package/dist/push.js.map +0 -1
- package/dist/source.d.ts +0 -10
- package/dist/source.d.ts.map +0 -1
- package/dist/source.js +0 -47
- package/dist/source.js.map +0 -1
- package/dist/types/code.d.ts +0 -23
- package/dist/types/code.d.ts.map +0 -1
- package/dist/types/code.js +0 -2
- package/dist/types/code.js.map +0 -1
- package/dist/types/collector.d.ts +0 -19
- package/dist/types/collector.d.ts.map +0 -1
- package/dist/types/collector.js +0 -2
- package/dist/types/collector.js.map +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -4
- package/dist/types/index.js.map +0 -1
|
@@ -1,471 +0,0 @@
|
|
|
1
|
-
import { clone, createEvent, createMockLogger } from '@walkeros/core';
|
|
2
|
-
import { pushToDestinations, startFlow } from '..';
|
|
3
|
-
describe('Destination', () => {
|
|
4
|
-
let event;
|
|
5
|
-
let destination;
|
|
6
|
-
let config;
|
|
7
|
-
let mockInit;
|
|
8
|
-
let mockPush;
|
|
9
|
-
function createDestination(args) {
|
|
10
|
-
return {
|
|
11
|
-
init: mockInit,
|
|
12
|
-
push: mockPush,
|
|
13
|
-
config: {},
|
|
14
|
-
...args,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
function createTestConfig(overrides = {}) {
|
|
18
|
-
return {
|
|
19
|
-
tagging: 1,
|
|
20
|
-
globalsStatic: {},
|
|
21
|
-
sessionStatic: {},
|
|
22
|
-
...overrides,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function createWalkerjs(args) {
|
|
26
|
-
const defaultConfig = createTestConfig();
|
|
27
|
-
// Create mock logger with proper scope chaining
|
|
28
|
-
const mockLogger = createMockLogger();
|
|
29
|
-
const scopedMockLogger = createMockLogger();
|
|
30
|
-
mockLogger.scope = jest.fn().mockReturnValue(scopedMockLogger);
|
|
31
|
-
return {
|
|
32
|
-
allowed: true,
|
|
33
|
-
destinations: { foo: destination },
|
|
34
|
-
globals: {},
|
|
35
|
-
hooks: {},
|
|
36
|
-
logger: mockLogger,
|
|
37
|
-
user: {},
|
|
38
|
-
consent: {},
|
|
39
|
-
queue: [],
|
|
40
|
-
...args,
|
|
41
|
-
config: args?.config ? createTestConfig(args.config) : defaultConfig,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
beforeEach(() => {
|
|
45
|
-
event = createEvent();
|
|
46
|
-
mockInit = jest.fn(); //.mockImplementation(console.log);
|
|
47
|
-
mockPush = jest.fn(); //.mockImplementation(console.log);
|
|
48
|
-
config = { init: false };
|
|
49
|
-
destination = {
|
|
50
|
-
init: mockInit,
|
|
51
|
-
push: mockPush,
|
|
52
|
-
config,
|
|
53
|
-
};
|
|
54
|
-
});
|
|
55
|
-
test('allowed', async () => {
|
|
56
|
-
const collector = createWalkerjs({ allowed: false });
|
|
57
|
-
let result = await pushToDestinations(collector, event);
|
|
58
|
-
expect(result.ok).toBeFalsy();
|
|
59
|
-
collector.allowed = true;
|
|
60
|
-
result = await pushToDestinations(collector, event);
|
|
61
|
-
expect(result.ok).toBeTruthy();
|
|
62
|
-
});
|
|
63
|
-
test('preventing data manipulation', async () => {
|
|
64
|
-
const clonedEvent = clone(event);
|
|
65
|
-
const mockPushUpdate = jest.fn().mockImplementation((event) => {
|
|
66
|
-
event.data.foo = 'bar';
|
|
67
|
-
});
|
|
68
|
-
const destinationUpdate = {
|
|
69
|
-
init: mockInit,
|
|
70
|
-
push: mockPushUpdate,
|
|
71
|
-
config: {},
|
|
72
|
-
};
|
|
73
|
-
await pushToDestinations(createWalkerjs(), event, {
|
|
74
|
-
destinationUpdate,
|
|
75
|
-
destination,
|
|
76
|
-
});
|
|
77
|
-
expect(mockPushUpdate).toHaveBeenCalledTimes(1);
|
|
78
|
-
expect(mockPush).toHaveBeenCalledTimes(1);
|
|
79
|
-
expect(mockPush).toHaveBeenCalledWith(clonedEvent, expect.objectContaining({
|
|
80
|
-
config: { init: true },
|
|
81
|
-
}));
|
|
82
|
-
});
|
|
83
|
-
test('failing init', async () => {
|
|
84
|
-
// Simulate a failed init
|
|
85
|
-
mockInit.mockImplementation(() => false);
|
|
86
|
-
await pushToDestinations(createWalkerjs(), event);
|
|
87
|
-
expect(mockInit).toHaveBeenCalledTimes(1);
|
|
88
|
-
expect(mockPush).toHaveBeenCalledTimes(0);
|
|
89
|
-
expect(destination.config.init).toBeFalsy();
|
|
90
|
-
});
|
|
91
|
-
test('logs init lifecycle', async () => {
|
|
92
|
-
const collector = createWalkerjs();
|
|
93
|
-
await pushToDestinations(collector, event);
|
|
94
|
-
expect(mockInit).toHaveBeenCalledTimes(1);
|
|
95
|
-
expect(mockPush).toHaveBeenCalledTimes(1);
|
|
96
|
-
// Verify logger.scope was called with destination type
|
|
97
|
-
expect(collector.logger.scope).toHaveBeenCalledWith('unknown');
|
|
98
|
-
// Get the scoped logger instance
|
|
99
|
-
const scopedLogger = collector.logger.scope.mock.results[0]
|
|
100
|
-
.value;
|
|
101
|
-
// Verify init lifecycle logs
|
|
102
|
-
expect(scopedLogger.debug).toHaveBeenCalledWith('init');
|
|
103
|
-
expect(scopedLogger.debug).toHaveBeenCalledWith('init done');
|
|
104
|
-
});
|
|
105
|
-
test('logs push lifecycle', async () => {
|
|
106
|
-
const collector = createWalkerjs();
|
|
107
|
-
destination.config.init = true; // Skip init for this test
|
|
108
|
-
await pushToDestinations(collector, event);
|
|
109
|
-
expect(mockPush).toHaveBeenCalledTimes(1);
|
|
110
|
-
// Verify logger.scope was called with destination type
|
|
111
|
-
expect(collector.logger.scope).toHaveBeenCalledWith('unknown');
|
|
112
|
-
// Get the scoped logger instance
|
|
113
|
-
const scopedLogger = collector.logger.scope.mock.results[0]
|
|
114
|
-
.value;
|
|
115
|
-
// Verify push lifecycle logs
|
|
116
|
-
expect(scopedLogger.debug).toHaveBeenCalledWith('push', {
|
|
117
|
-
event: event.name,
|
|
118
|
-
});
|
|
119
|
-
expect(scopedLogger.debug).toHaveBeenCalledWith('push done');
|
|
120
|
-
});
|
|
121
|
-
test('DLQ', async () => {
|
|
122
|
-
const event = createEvent();
|
|
123
|
-
// Simulate a failing push
|
|
124
|
-
mockPush.mockImplementation(() => {
|
|
125
|
-
throw new Error('kaputt');
|
|
126
|
-
});
|
|
127
|
-
const destination = createDestination();
|
|
128
|
-
const result = await pushToDestinations(createWalkerjs(), event, {
|
|
129
|
-
destination,
|
|
130
|
-
});
|
|
131
|
-
expect(result.failed).toHaveLength(1);
|
|
132
|
-
expect(result.ok).toBeFalsy();
|
|
133
|
-
expect(mockPush).toHaveBeenCalledTimes(1);
|
|
134
|
-
expect(destination.dlq).toContainEqual([event, new Error('kaputt')]);
|
|
135
|
-
});
|
|
136
|
-
test('skip on denied consent', async () => { });
|
|
137
|
-
describe('destination on method', () => {
|
|
138
|
-
let mockOnMethod;
|
|
139
|
-
beforeEach(() => {
|
|
140
|
-
mockOnMethod = jest.fn();
|
|
141
|
-
});
|
|
142
|
-
it('should call destination on method when consent event is triggered', async () => {
|
|
143
|
-
const destinationWithOn = createDestination({
|
|
144
|
-
on: mockOnMethod,
|
|
145
|
-
config: { init: true },
|
|
146
|
-
});
|
|
147
|
-
const { collector, elb } = await startFlow({
|
|
148
|
-
destinations: { testDestination: { code: destinationWithOn } },
|
|
149
|
-
});
|
|
150
|
-
// Trigger consent event
|
|
151
|
-
await elb('walker consent', { marketing: true });
|
|
152
|
-
// Verify the destination's on method was called with consent context
|
|
153
|
-
expect(mockOnMethod).toHaveBeenCalledWith('consent', expect.objectContaining({
|
|
154
|
-
data: { marketing: true },
|
|
155
|
-
collector: expect.any(Object),
|
|
156
|
-
config: expect.any(Object),
|
|
157
|
-
env: expect.any(Object),
|
|
158
|
-
logger: expect.any(Object),
|
|
159
|
-
}));
|
|
160
|
-
});
|
|
161
|
-
it('should call destination on method when session event is triggered', async () => {
|
|
162
|
-
const destinationWithOn = createDestination({
|
|
163
|
-
on: mockOnMethod,
|
|
164
|
-
config: { init: true },
|
|
165
|
-
});
|
|
166
|
-
const { collector, elb } = await startFlow({
|
|
167
|
-
destinations: { testDestination: { code: destinationWithOn } },
|
|
168
|
-
});
|
|
169
|
-
// Set session data and trigger session event
|
|
170
|
-
collector.session = {
|
|
171
|
-
id: 'test-session',
|
|
172
|
-
isStart: true,
|
|
173
|
-
storage: false,
|
|
174
|
-
device: 'test',
|
|
175
|
-
};
|
|
176
|
-
await elb('walker session');
|
|
177
|
-
// Verify the destination's on method was called with session context
|
|
178
|
-
expect(mockOnMethod).toHaveBeenCalledWith('session', expect.objectContaining({
|
|
179
|
-
data: collector.session,
|
|
180
|
-
collector: expect.any(Object),
|
|
181
|
-
config: expect.any(Object),
|
|
182
|
-
env: expect.any(Object),
|
|
183
|
-
logger: expect.any(Object),
|
|
184
|
-
}));
|
|
185
|
-
});
|
|
186
|
-
it('should call destination on method when ready event is triggered', async () => {
|
|
187
|
-
const destinationWithOn = createDestination({
|
|
188
|
-
on: mockOnMethod,
|
|
189
|
-
config: { init: true },
|
|
190
|
-
});
|
|
191
|
-
const { collector, elb } = await startFlow({
|
|
192
|
-
destinations: { testDestination: { code: destinationWithOn } },
|
|
193
|
-
});
|
|
194
|
-
// Trigger ready event
|
|
195
|
-
await elb('walker ready');
|
|
196
|
-
// Verify the destination's on method was called
|
|
197
|
-
expect(mockOnMethod).toHaveBeenCalledWith('ready', expect.objectContaining({
|
|
198
|
-
data: undefined,
|
|
199
|
-
collector: expect.any(Object),
|
|
200
|
-
config: expect.any(Object),
|
|
201
|
-
env: expect.any(Object),
|
|
202
|
-
logger: expect.any(Object),
|
|
203
|
-
}));
|
|
204
|
-
});
|
|
205
|
-
it('should call destination on method when run event is triggered', async () => {
|
|
206
|
-
const destinationWithOn = createDestination({
|
|
207
|
-
on: mockOnMethod,
|
|
208
|
-
config: { init: true },
|
|
209
|
-
});
|
|
210
|
-
const { collector, elb } = await startFlow({
|
|
211
|
-
destinations: { testDestination: { code: destinationWithOn } },
|
|
212
|
-
});
|
|
213
|
-
// Trigger run event
|
|
214
|
-
await elb('walker run');
|
|
215
|
-
// Verify the destination's on method was called
|
|
216
|
-
expect(mockOnMethod).toHaveBeenCalledWith('run', expect.objectContaining({
|
|
217
|
-
data: undefined,
|
|
218
|
-
collector: expect.any(Object),
|
|
219
|
-
config: expect.any(Object),
|
|
220
|
-
env: expect.any(Object),
|
|
221
|
-
logger: expect.any(Object),
|
|
222
|
-
}));
|
|
223
|
-
});
|
|
224
|
-
it('should not fail if destination does not have on method', async () => {
|
|
225
|
-
const destinationWithoutOn = createDestination({
|
|
226
|
-
config: { init: true },
|
|
227
|
-
});
|
|
228
|
-
const { collector, elb } = await startFlow({
|
|
229
|
-
destinations: { testDestination: { code: destinationWithoutOn } },
|
|
230
|
-
});
|
|
231
|
-
// Should not throw when destination has no on method
|
|
232
|
-
expect(async () => {
|
|
233
|
-
await elb('walker consent', { marketing: true });
|
|
234
|
-
await elb('walker session');
|
|
235
|
-
await elb('walker ready');
|
|
236
|
-
await elb('walker run');
|
|
237
|
-
}).not.toThrow();
|
|
238
|
-
});
|
|
239
|
-
it('should handle async on method', async () => {
|
|
240
|
-
const asyncOnMethod = jest.fn().mockResolvedValue(undefined);
|
|
241
|
-
const destinationWithAsyncOn = createDestination({
|
|
242
|
-
on: asyncOnMethod,
|
|
243
|
-
config: { init: true },
|
|
244
|
-
});
|
|
245
|
-
const { collector, elb } = await startFlow({
|
|
246
|
-
destinations: { testDestination: { code: destinationWithAsyncOn } },
|
|
247
|
-
});
|
|
248
|
-
// Trigger consent event
|
|
249
|
-
await elb('walker consent', { marketing: true });
|
|
250
|
-
// Verify the async destination's on method was called
|
|
251
|
-
expect(asyncOnMethod).toHaveBeenCalledWith('consent', expect.objectContaining({
|
|
252
|
-
data: { marketing: true },
|
|
253
|
-
collector: expect.any(Object),
|
|
254
|
-
config: expect.any(Object),
|
|
255
|
-
env: expect.any(Object),
|
|
256
|
-
logger: expect.any(Object),
|
|
257
|
-
}));
|
|
258
|
-
});
|
|
259
|
-
it('should call on method for multiple destinations', async () => {
|
|
260
|
-
const mockOn1 = jest.fn();
|
|
261
|
-
const mockOn2 = jest.fn();
|
|
262
|
-
const destination1 = createDestination({
|
|
263
|
-
on: mockOn1,
|
|
264
|
-
config: { init: true },
|
|
265
|
-
});
|
|
266
|
-
const destination2 = createDestination({
|
|
267
|
-
on: mockOn2,
|
|
268
|
-
config: { init: true },
|
|
269
|
-
});
|
|
270
|
-
const { collector, elb } = await startFlow({
|
|
271
|
-
destinations: {
|
|
272
|
-
dest1: { code: destination1 },
|
|
273
|
-
dest2: { code: destination2 },
|
|
274
|
-
},
|
|
275
|
-
});
|
|
276
|
-
// Trigger consent event
|
|
277
|
-
await elb('walker consent', { marketing: true });
|
|
278
|
-
// Both destinations should receive the event
|
|
279
|
-
expect(mockOn1).toHaveBeenCalledWith('consent', expect.objectContaining({
|
|
280
|
-
data: { marketing: true },
|
|
281
|
-
collector: expect.any(Object),
|
|
282
|
-
config: expect.any(Object),
|
|
283
|
-
env: expect.any(Object),
|
|
284
|
-
logger: expect.any(Object),
|
|
285
|
-
}));
|
|
286
|
-
expect(mockOn2).toHaveBeenCalledWith('consent', expect.objectContaining({
|
|
287
|
-
data: { marketing: true },
|
|
288
|
-
collector: expect.any(Object),
|
|
289
|
-
config: expect.any(Object),
|
|
290
|
-
env: expect.any(Object),
|
|
291
|
-
logger: expect.any(Object),
|
|
292
|
-
}));
|
|
293
|
-
});
|
|
294
|
-
it('should handle on method errors gracefully', async () => {
|
|
295
|
-
const errorOnMethod = jest.fn().mockImplementation(() => {
|
|
296
|
-
throw new Error('On method error');
|
|
297
|
-
});
|
|
298
|
-
const destinationWithErrorOn = createDestination({
|
|
299
|
-
on: errorOnMethod,
|
|
300
|
-
config: { init: true },
|
|
301
|
-
});
|
|
302
|
-
const { collector, elb } = await startFlow({
|
|
303
|
-
destinations: { testDestination: { code: destinationWithErrorOn } },
|
|
304
|
-
});
|
|
305
|
-
// Should not throw even if on method throws an error
|
|
306
|
-
expect(async () => {
|
|
307
|
-
await elb('walker consent', { marketing: true });
|
|
308
|
-
}).not.toThrow();
|
|
309
|
-
// On method should still have been called
|
|
310
|
-
expect(errorOnMethod).toHaveBeenCalledWith('consent', expect.objectContaining({
|
|
311
|
-
data: { marketing: true },
|
|
312
|
-
collector: expect.any(Object),
|
|
313
|
-
config: expect.any(Object),
|
|
314
|
-
env: expect.any(Object),
|
|
315
|
-
logger: expect.any(Object),
|
|
316
|
-
}));
|
|
317
|
-
});
|
|
318
|
-
});
|
|
319
|
-
describe('batch with wildcard mapping', () => {
|
|
320
|
-
beforeEach(() => {
|
|
321
|
-
jest.useFakeTimers();
|
|
322
|
-
});
|
|
323
|
-
afterEach(() => {
|
|
324
|
-
jest.useRealTimers();
|
|
325
|
-
});
|
|
326
|
-
it('should not duplicate events when using wildcard batch config', async () => {
|
|
327
|
-
// Capture events at call time (since batched.events gets cleared after pushBatch)
|
|
328
|
-
const capturedBatches = [];
|
|
329
|
-
const mockPushBatch = jest.fn((batch) => {
|
|
330
|
-
// Clone the events array to capture at call time
|
|
331
|
-
capturedBatches.push({
|
|
332
|
-
events: [...batch.events],
|
|
333
|
-
key: batch.key,
|
|
334
|
-
});
|
|
335
|
-
});
|
|
336
|
-
const mockPush = jest.fn();
|
|
337
|
-
const destinationWithBatch = {
|
|
338
|
-
push: mockPush,
|
|
339
|
-
pushBatch: mockPushBatch,
|
|
340
|
-
config: {
|
|
341
|
-
init: true,
|
|
342
|
-
mapping: {
|
|
343
|
-
'*': {
|
|
344
|
-
'*': { batch: 50 }, // 50ms debounce
|
|
345
|
-
},
|
|
346
|
-
},
|
|
347
|
-
},
|
|
348
|
-
};
|
|
349
|
-
const { elb } = await startFlow({
|
|
350
|
-
destinations: { batchDest: { code: destinationWithBatch } },
|
|
351
|
-
});
|
|
352
|
-
// Send different event types (all should match wildcard)
|
|
353
|
-
await elb('page view');
|
|
354
|
-
await elb('product click');
|
|
355
|
-
await elb('button press');
|
|
356
|
-
// Advance timers to trigger debounce
|
|
357
|
-
jest.advanceTimersByTime(100);
|
|
358
|
-
// pushBatch should be called exactly once with all 3 events
|
|
359
|
-
expect(mockPushBatch).toHaveBeenCalledTimes(1);
|
|
360
|
-
expect(capturedBatches[0].events).toHaveLength(3);
|
|
361
|
-
// Verify all events are present (not duplicated)
|
|
362
|
-
const eventNames = capturedBatches[0].events.map((e) => e.name);
|
|
363
|
-
expect(eventNames).toContain('page view');
|
|
364
|
-
expect(eventNames).toContain('product click');
|
|
365
|
-
expect(eventNames).toContain('button press');
|
|
366
|
-
// Individual push should NOT be called (batch handles it)
|
|
367
|
-
expect(mockPush).not.toHaveBeenCalled();
|
|
368
|
-
});
|
|
369
|
-
it('should batch events separately per mapping key', async () => {
|
|
370
|
-
// Capture events at call time
|
|
371
|
-
const capturedBatches = [];
|
|
372
|
-
const mockPushBatch = jest.fn((batch) => {
|
|
373
|
-
capturedBatches.push({
|
|
374
|
-
events: [...batch.events],
|
|
375
|
-
key: batch.key,
|
|
376
|
-
});
|
|
377
|
-
});
|
|
378
|
-
const mockPush = jest.fn();
|
|
379
|
-
const destinationWithBatch = {
|
|
380
|
-
push: mockPush,
|
|
381
|
-
pushBatch: mockPushBatch,
|
|
382
|
-
config: {
|
|
383
|
-
init: true,
|
|
384
|
-
mapping: {
|
|
385
|
-
page: {
|
|
386
|
-
'*': { batch: 50 }, // page events batch together
|
|
387
|
-
},
|
|
388
|
-
product: {
|
|
389
|
-
'*': { batch: 50 }, // product events batch together
|
|
390
|
-
},
|
|
391
|
-
},
|
|
392
|
-
},
|
|
393
|
-
};
|
|
394
|
-
const { elb } = await startFlow({
|
|
395
|
-
destinations: { batchDest: { code: destinationWithBatch } },
|
|
396
|
-
});
|
|
397
|
-
// Send events that match different mapping keys
|
|
398
|
-
await elb('page view');
|
|
399
|
-
await elb('page scroll');
|
|
400
|
-
await elb('product click');
|
|
401
|
-
await elb('product view');
|
|
402
|
-
// Advance timers to trigger debounce
|
|
403
|
-
jest.advanceTimersByTime(100);
|
|
404
|
-
// pushBatch should be called twice (once per mapping key)
|
|
405
|
-
expect(mockPushBatch).toHaveBeenCalledTimes(2);
|
|
406
|
-
// Each batch should have 2 events
|
|
407
|
-
expect(capturedBatches[0].events).toHaveLength(2);
|
|
408
|
-
expect(capturedBatches[1].events).toHaveLength(2);
|
|
409
|
-
});
|
|
410
|
-
it('should isolate batch state when multiple destinations share same mapping config', async () => {
|
|
411
|
-
// This test reproduces the bug where shared mapping config causes duplicate events
|
|
412
|
-
// Two destinations with the SAME mapping config object (shared reference)
|
|
413
|
-
const sharedMapping = {
|
|
414
|
-
'*': {
|
|
415
|
-
'*': { batch: 50 },
|
|
416
|
-
},
|
|
417
|
-
};
|
|
418
|
-
const capturedBatches = [];
|
|
419
|
-
const mockPushBatch1 = jest.fn((batch) => {
|
|
420
|
-
capturedBatches.push({
|
|
421
|
-
destination: 'dest1',
|
|
422
|
-
events: [...batch.events],
|
|
423
|
-
key: batch.key,
|
|
424
|
-
});
|
|
425
|
-
});
|
|
426
|
-
const mockPushBatch2 = jest.fn((batch) => {
|
|
427
|
-
capturedBatches.push({
|
|
428
|
-
destination: 'dest2',
|
|
429
|
-
events: [...batch.events],
|
|
430
|
-
key: batch.key,
|
|
431
|
-
});
|
|
432
|
-
});
|
|
433
|
-
const destination1 = {
|
|
434
|
-
push: jest.fn(),
|
|
435
|
-
pushBatch: mockPushBatch1,
|
|
436
|
-
config: {
|
|
437
|
-
init: true,
|
|
438
|
-
mapping: sharedMapping, // Shared reference!
|
|
439
|
-
},
|
|
440
|
-
};
|
|
441
|
-
const destination2 = {
|
|
442
|
-
push: jest.fn(),
|
|
443
|
-
pushBatch: mockPushBatch2,
|
|
444
|
-
config: {
|
|
445
|
-
init: true,
|
|
446
|
-
mapping: sharedMapping, // Same shared reference!
|
|
447
|
-
},
|
|
448
|
-
};
|
|
449
|
-
const { elb } = await startFlow({
|
|
450
|
-
destinations: {
|
|
451
|
-
dest1: { code: destination1 },
|
|
452
|
-
dest2: { code: destination2 },
|
|
453
|
-
},
|
|
454
|
-
});
|
|
455
|
-
// Send events
|
|
456
|
-
await elb('page view');
|
|
457
|
-
await elb('product click');
|
|
458
|
-
// Advance timers to trigger debounce
|
|
459
|
-
jest.advanceTimersByTime(100);
|
|
460
|
-
// Each destination should receive its own batch
|
|
461
|
-
// BUG: Currently shared mapping causes only last destination to receive events
|
|
462
|
-
// or events get duplicated across destinations
|
|
463
|
-
const totalPushBatchCalls = mockPushBatch1.mock.calls.length + mockPushBatch2.mock.calls.length;
|
|
464
|
-
expect(totalPushBatchCalls).toBe(2); // Should be 2 (one per destination)
|
|
465
|
-
// Each destination should receive exactly 2 events
|
|
466
|
-
expect(mockPushBatch1).toHaveBeenCalledTimes(1);
|
|
467
|
-
expect(mockPushBatch2).toHaveBeenCalledTimes(1);
|
|
468
|
-
});
|
|
469
|
-
});
|
|
470
|
-
});
|
|
471
|
-
//# sourceMappingURL=destination.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"destination.test.js","sourceRoot":"","sources":["../../src/__tests__/destination.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEnD,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAI,KAAqB,CAAC;IAC1B,IAAI,WAAiC,CAAC;IACtC,IAAI,MAA0B,CAAC;IAC/B,IAAI,QAAmB,CAAC;IACxB,IAAI,QAAmB,CAAC;IAExB,SAAS,iBAAiB,CACxB,IAAoC;QAEpC,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,EAAE;YACV,GAAG,IAAI;SACgB,CAAC;IAC5B,CAAC;IAED,SAAS,gBAAgB,CACvB,YAAuC,EAAE;QAEzC,OAAO;YACL,O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/handle.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { startFlow } from '..';
|
|
2
|
-
import { commonHandleCommand } from '../handle';
|
|
3
|
-
describe('Handle Commands', () => {
|
|
4
|
-
let mockDestinationPush;
|
|
5
|
-
let mockDestinationInit;
|
|
6
|
-
let mockDestination;
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
jest.clearAllMocks();
|
|
9
|
-
mockDestinationPush = jest.fn();
|
|
10
|
-
mockDestinationInit = jest.fn().mockResolvedValue({ settings: {} });
|
|
11
|
-
mockDestination = {
|
|
12
|
-
type: 'test',
|
|
13
|
-
config: {},
|
|
14
|
-
init: mockDestinationInit,
|
|
15
|
-
push: mockDestinationPush,
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
describe('walker destination command', () => {
|
|
19
|
-
test('adds destination without config', async () => {
|
|
20
|
-
const { elb, collector } = await startFlow({});
|
|
21
|
-
// Initially no destinations
|
|
22
|
-
expect(Object.keys(collector.destinations)).toHaveLength(0);
|
|
23
|
-
// Add destination without config
|
|
24
|
-
await elb('walker destination', mockDestination);
|
|
25
|
-
// Destination should be added with some default config
|
|
26
|
-
expect(Object.keys(collector.destinations)).toHaveLength(1);
|
|
27
|
-
const destinationId = Object.keys(collector.destinations)[0];
|
|
28
|
-
expect(collector.destinations[destinationId]).toBeDefined();
|
|
29
|
-
expect(collector.destinations[destinationId].config).toBeDefined();
|
|
30
|
-
});
|
|
31
|
-
test('adds destination with config including custom id', async () => {
|
|
32
|
-
const { elb, collector } = await startFlow({});
|
|
33
|
-
const customConfig = {
|
|
34
|
-
id: 'my-custom-id',
|
|
35
|
-
init: true,
|
|
36
|
-
loadScript: false,
|
|
37
|
-
mapping: {
|
|
38
|
-
entity: {
|
|
39
|
-
action: {
|
|
40
|
-
name: 'CustomEvent',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
// Add destination with config
|
|
46
|
-
await elb('walker destination', mockDestination, customConfig);
|
|
47
|
-
// Destination should be added with custom id and config
|
|
48
|
-
expect(Object.keys(collector.destinations)).toEqual(['my-custom-id']);
|
|
49
|
-
expect(collector.destinations['my-custom-id']).toBeDefined();
|
|
50
|
-
expect(collector.destinations['my-custom-id'].config).toEqual(customConfig);
|
|
51
|
-
});
|
|
52
|
-
test('adds destination with config and stores it properly', async () => {
|
|
53
|
-
const { elb, collector } = await startFlow({});
|
|
54
|
-
const customConfig = {
|
|
55
|
-
id: 'test-destination',
|
|
56
|
-
settings: { apiKey: 'test-key' },
|
|
57
|
-
};
|
|
58
|
-
// Add destination with config
|
|
59
|
-
await elb('walker destination', mockDestination, customConfig);
|
|
60
|
-
// Destination should be added with custom config
|
|
61
|
-
expect(collector.destinations['test-destination']).toBeDefined();
|
|
62
|
-
expect(collector.destinations['test-destination'].config).toEqual(customConfig);
|
|
63
|
-
});
|
|
64
|
-
test('handles destination config through commonHandleCommand', async () => {
|
|
65
|
-
const { collector } = await startFlow({});
|
|
66
|
-
const customConfig = {
|
|
67
|
-
id: 'cmd-test',
|
|
68
|
-
settings: { foo: 'bar' },
|
|
69
|
-
};
|
|
70
|
-
// Call commonHandleCommand directly
|
|
71
|
-
await commonHandleCommand(collector, 'destination', mockDestination, customConfig);
|
|
72
|
-
// Destination should be added with config
|
|
73
|
-
expect(collector.destinations['cmd-test']).toBeDefined();
|
|
74
|
-
expect(collector.destinations['cmd-test'].config).toEqual(customConfig);
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
//# sourceMappingURL=handle.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handle.test.js","sourceRoot":"","sources":["../../src/__tests__/handle.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,QAAQ,CAAC,iBAAiB,EAAE,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