kenspirit / joi-to-json

Capable of converting different versions' joi object to json schema
MIT License
40 stars 18 forks source link

Add unit tests #9

Closed simlu closed 1 year ago

simlu commented 4 years ago

Things are getting pretty complicated and I vote for adding unit tests... should make everything a lot cleaner.

The way that I see this: (1) have a joi schema (2) generate the json schema (3) check that the joi and json schema both validate / fail to validate certain data

kenspirit commented 4 years ago

@simlu I admit that more test cases and scenarios should be covered.

The current test is also trying to make all kinds of different cases into a big complex joi schema for every version and come up with a universal json schema to check against.

Your supplemented scenarios are very helpful as I could not think out all possible scenarios.

Will try to add more and thanks as always.

kenspirit commented 1 year ago

Code is refactored and UT has been added already