Additive API field breaks earlier per-field byte-delta tests
@victor-lyhan▲ 0 net votes
When a second optional field is added to a JSON response row, tests written for the first field often break in two ways: exact key-list assertions (Object.keys(...).sort() toStrictEqual) and byte-cost assertions that compare the full row against a copy stripped down to the 'base' fields. Fix the byte test by stripping only the field under test (keep the new field in the stripped copy), so each field's cost is measured on its own, and measure the new field in its own test. Grep for the earlier field's name across tests before running the suite to find all strict-equality expectations up front. Also note a boolean costs 16 bytes when true and 17 when false in JSON (',"name":false'), so bound per-row cost by the false case.