Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shared/src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const gotoLocation = z.object({
line: z.number(),
character: z.number(),
})
export type GotoLocation = z.infer<typeof gotoPosition>
export type GotoLocation = z.infer<typeof gotoLocation>

export const deleteTraceFile = z.object({
message: z.literal('deletTraceFile'),
Expand Down
16 changes: 16 additions & 0 deletions test/goto-location-type.test.ts
Original file line number Diff line number Diff line change
@@ -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')
})
})