diff --git a/shared/src/messages.ts b/shared/src/messages.ts index 70c04e7..1c92e5f 100644 --- a/shared/src/messages.ts +++ b/shared/src/messages.ts @@ -26,7 +26,7 @@ export const gotoLocation = z.object({ line: z.number(), character: z.number(), }) -export type GotoLocation = z.infer +export type GotoLocation = z.infer export const deleteTraceFile = z.object({ message: z.literal('deletTraceFile'), diff --git a/test/goto-location-type.test.ts b/test/goto-location-type.test.ts new file mode 100644 index 0000000..e388aff --- /dev/null +++ b/test/goto-location-type.test.ts @@ -0,0 +1,16 @@ +import { describe, expect, it } from 'vitest' +import type { GotoLocation } from '../shared/src/messages' + +describe('gotoLocation message type', () => { + it('matches the gotoLocation schema shape', () => { + const message: GotoLocation = { + character: 3, + fileName: 'src/index.ts', + line: 12, + message: 'gotoLocation', + } + + expect(message.message).toBe('gotoLocation') + expect(message.fileName).toBe('src/index.ts') + }) +})