Skip to content

Commit 223cf45

Browse files
cursoragentclaude
andcommitted
test(core): add proper assertion for flags context in error events
The test for copyFlagsFromScopeToEvent was not actually verifying that the flags were copied to the event. Since the function mutates and returns the same event object, checking result === event is trivially true. Added assertion to verify event.contexts.flags contains the expected flags. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 53e6de3 commit 223cf45

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/core/test/lib/utils/featureFlags.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,13 @@ describe('flags', () => {
164164

165165
const result = _INTERNAL_copyFlagsFromScopeToEvent(event);
166166

167-
expect(result).toEqual(event);
168167
expect(getCurrentScope).toHaveBeenCalled();
168+
expect(result.contexts?.flags).toEqual({
169+
values: [
170+
{ flag: 'feat1', result: true },
171+
{ flag: 'feat2', result: false },
172+
],
173+
});
169174
});
170175
});
171176
});

0 commit comments

Comments
 (0)