Open Beastlybear2017 opened 12 months ago
@Beastlybear2017 you can try to write a test, where to check if your solutions works.
Here, for instance, test case that checks if the notifyChange
works:
You can add more cases like that where you check scenarios like “what if you provided no keys at all, that way it should notify every time” or “what if I provided the keys that doesn't exist in metadata, it should notify” and so on.
I have added the tests (updated yours to use the new system), fixed any issues and commited my changes. All the tests pass / fail when they should https://github.com/Beastlybear2017/icecast-parser/blob/ccab52975b0fdf5586ff5734e9a171cdcffe779a/test/Parser.spec.ts#L68-L95
Was able to test within my project and fixed an issue that I discorvered. Now works as intened
Great work!
However, let's keep it backward compatible with older API. Let's leave the possibility to specify the boolean as before.
I apologise if this is really dumb, I have never attempted to contribute towards a npm package before and have no clue how to / if it is possible to test it from a local file.
Here is my vision of how this would work, although have no clue if it works in practice :)