11import { describe , expect , test } from 'vitest'
22import { PING_END , PING_START } from '../src/constants'
33import { parseClockRound , parseClockSet , parseListening , parsePing } from '../src/listening'
4- import type { Timestamp , RParsedSentence } from '../src/types'
4+ import type { Timestamp , ParsedSentence } from '../src/types'
55
66const timestamp : Timestamp = Date . now ( )
77
88describe ( 'parsePing' , ( ) => {
99 test ( 'happy path - valid serial number' , ( ) => {
1010 const input = `${ PING_START } 123456 ${ PING_END } `
1111 const result = parsePing ( input , timestamp )
12- const expected : RParsedSentence = {
12+ const expected : ParsedSentence = {
1313 raw : input ,
1414 id : 'ping' ,
1515 firmware : '1.0.2' ,
@@ -30,7 +30,7 @@ describe('parsePing', () => {
3030 test ( 'invalid serial number - not a number' , ( ) => {
3131 const input = `${ PING_START } 12345a${ PING_END } `
3232 const result = parsePing ( input , timestamp )
33- const expected : RParsedSentence = {
33+ const expected : ParsedSentence = {
3434 raw : input ,
3535 id : 'ping' ,
3636 firmware : '1.0.2' ,
@@ -55,7 +55,7 @@ describe('parsePing', () => {
5555 test ( 'invalid serial number - negative number' , ( ) => {
5656 const input = `${ PING_START } -123456${ PING_END } `
5757 const result = parsePing ( input , timestamp )
58- const expected : RParsedSentence = {
58+ const expected : ParsedSentence = {
5959 raw : input ,
6060 id : 'ping' ,
6161 firmware : '1.0.2' ,
@@ -82,7 +82,7 @@ describe('parseClockRound', () => {
8282 test ( 'happy path' , ( ) => {
8383 const input = 'ack01\r'
8484 const result = parseClockRound ( input , timestamp )
85- const expected : RParsedSentence = {
85+ const expected : ParsedSentence = {
8686 raw : input ,
8787 id : 'clock round' ,
8888 firmware : '1.0.2' ,
@@ -104,7 +104,7 @@ describe('parseClockSet', () => {
104104 test ( 'happy path' , ( ) => {
105105 const input = 'ack02\r'
106106 const result = parseClockSet ( input , timestamp )
107- const expected : RParsedSentence = {
107+ const expected : ParsedSentence = {
108108 raw : input ,
109109 id : 'clock set' ,
110110 firmware : '1.0.2' ,
@@ -126,7 +126,7 @@ describe('parseListening', () => {
126126 test ( 'happy path' , ( ) => {
127127 const input = 'EX!'
128128 const result = parseListening ( input , timestamp )
129- const expected : RParsedSentence = {
129+ const expected : ParsedSentence = {
130130 raw : input ,
131131 id : 'listening' ,
132132 firmware : '1.0.2' ,
0 commit comments