Considering the repo is now setup for nodejs and the fact that the javascript files have been turned into modules makes it fairly easy to import message_parsing.mjs into vitest or some other unittest framework.
Thinking about it, I am not entirely sure if it makes sense to have actual unit tests for the individual functions. That might be overkill, certainly after the fact.
But to prevent regression in the future it might make sense to go for unit integration level tests where a variety of minecraft JSON messages are fed in to validate basic parsing. @danthedaniel thoughts?
Considering the repo is now setup for nodejs and the fact that the javascript files have been turned into modules makes it fairly easy to import
message_parsing.mjsintovitestor some other unittest framework.Thinking about it, I am not entirely sure if it makes sense to have actual unit tests for the individual functions. That might be overkill, certainly after the fact.
But to prevent regression in the future it might make sense to go for unit integration level tests where a variety of minecraft JSON messages are fed in to validate basic parsing. @danthedaniel thoughts?