Skip to content

An open-source, faster Devin alternative

TypeScript

Schema: test that a Session without aside decodes

Igor Zalutski via Computer72770833608c
diff --git a/computer/src/api/fold.test.ts b/computer/src/api/fold.test.ts
index 754a95f5..e6c3771b 100644
--- a/computer/src/api/fold.test.ts
+++ b/computer/src/api/fold.test.ts
@@ -90,6 +90,9 @@ describe('Fold', () => {
expect(fold.session()).toMatchObject({ title: 'T', archived: true, aside: false, settings: { model: 'm2' }, metadata: { k: 'v' } });
add('session.updated', { changes: { 'metadata.k': { from: 'v', to: null } } });
expect(fold.session().metadata).toEqual({});
+ // Optional in the schema: a Session without it (from a computer older than set-aside) still decodes.
+ const { aside: _, ...older } = fold.session();
+ expect(Schema.decodeUnknownSync(Session)(older)).not.toHaveProperty('aside');
});
it('speed: null from a session.created written before it, then what session.updated sets', () => {