Skip to content

Commit 4ebb3ff

Browse files
committed
Ignore cache keys in serialize addon
Bit hacky, but this is due to the way we're serializing the line in the test
1 parent 093e81b commit 4ebb3ff

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

addons/addon-serialize/test/SerializeAddon.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ test.describe('SerializeAddon', () => {
4949
for (let i = 0; i < buffer.length; i++) {
5050
// Do this intentionally to get content of underlining source
5151
const bufferLine = buffer.getLine(i)._line;
52-
lines.push(JSON.stringify(bufferLine));
52+
lines.push(JSON.stringify(bufferLine, (key, value) => {
53+
// BufferLine caches are internal/transient and can legitimately differ
54+
// across equivalent terminal states.
55+
if (key === '_stringCache' || key === '_stringCacheEntryRef') {
56+
return undefined;
57+
}
58+
return value;
59+
}));
5360
}
5461
return {
5562
x: buffer.cursorX,

0 commit comments

Comments
 (0)