Skip to content

Conversation

@mag123c
Copy link
Contributor

@mag123c mag123c commented Oct 24, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Sample 34 E2E test fails with superjson 2.2.3 due to exact JSON string matching

expected '{"jsonString":"{"json":{"big":"10"},"meta":{"values":{"big":["bigint"]}}}"}'
got      '{"jsonString":"{"json":{"big":"10"},"meta":{"values":{"big":["bigint"]},"v":1}}"}'

Sample 34's purpose is to demonstrate ESM package import, not to validate superjson's serialization format.

superjson 2.2.3 was published to npm on Oct 22, 2025 (06:20 UTC), and CI tests started failing immediately after. The package added a "v": 1 field to the meta object for backward compatibility

Root Cause

  • Test uses exact JSON string comparison
  • superjson 2.2.3 added internal version field for backward compatibility (PR #311)
  • Test breaks on external package's internal format changes

Issue Number: #15834

What is the new behavior?

Changed test from exact JSON string matching to object comparison

// Before
.expect(
  JSON.stringify({
    jsonString: '{"json":{"big":"10"},"meta":{"values":{"big":["bigint"]}}}',
  }),
);

// After
.expect((res) => {
  const result = JSON.parse(res.body.jsonString);
  expect(result.json.big).toBe('10');
  expect(result.meta.values.big).toEqual(['bigint']);
});

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Related

Alternatives considered

  1. Object comparison (implemented) - most robust
  2. Pin superjson to 2.2.2 - prevents testing with latest packages
  3. Update expected output to include "v": 1 - still fragile to future changes

@coveralls
Copy link

Pull Request Test Coverage Report for Build c7b4757d-3677-4e99-bb30-19d42de316cb

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 88.888%

Totals Coverage Status
Change from base Build 3a48f653-e287-441b-b2b2-c3e90f54cf30: 0.0%
Covered Lines: 7319
Relevant Lines: 8234

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants