Skip to content

Commit 23e006d

Browse files
antonisclaude
andcommitted
fix(core): Update Object.freeze test for strict mode after SDK bump
`@sentry-internal/typescript` 10.53.1 removed `alwaysStrict: false`, so ts-jest now emits `"use strict"` and frozen property assignment throws. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cfe9bce commit 23e006d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/core/test/typings/object-freeze.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,11 @@ describe('Object.freeze type inference', () => {
7979
it('should maintain type safety and prevent modifications at compile time', () => {
8080
const frozen = Object.freeze({ value: 42 });
8181

82-
// Runtime: attempting to modify should silently fail (in non-strict mode)
83-
// or throw (in strict mode)
82+
// Jest runs in strict mode, so assigning to a frozen property throws
8483
expect(() => {
8584
// @ts-expect-error - TypeScript should prevent this at compile time
8685
(frozen as any).value = 100;
87-
}).not.toThrow(); // In non-strict mode, this silently fails
86+
}).toThrow(TypeError);
8887

8988
// Value should remain unchanged
9089
expect(frozen.value).toBe(42);

0 commit comments

Comments
 (0)