Skip to content

Commit

Permalink
add meteo test
Browse files Browse the repository at this point in the history
  • Loading branch information
tkurki committed Feb 10, 2024
1 parent 9b0b352 commit 6887a9d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/VDM.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,23 @@ describe('VDM', function () {
.filter((pathValue) => pathValue.path === '')[3]
.value.registrations.imo.should.equal('IMO 1010258')
})

it('meteo converts ok', () => {
const delta = new Parser().parse(
'!AIVDM,1,1,,A,8@2R5Ph0GhOCT1a2VvkrgwvlFR06EuOwgqrqwnSwe7wvlOwwsAwwnSGmwvwt,0*40'
)
delta.context.should.equal('meteo.urn:mrn:imo:mmsi:002655619.366097')
const output = [
['environment.water.level', -0.17],
['environment.water.levelTendency', 'steady'],
['environment.water.levelTendencyValue', 0],
['environment.date', '2024-02-22T15:42:00.000Z']
]
output.forEach(([path, value]) =>
delta.updates[0].values
.find((pathValue) => pathValue.path === path)
.value.should.equal(value)
)
})

})

0 comments on commit 6887a9d

Please sign in to comment.