@Puppo92
Microsoft MVP, Google Developer Expert, GitKraken Ambassador, Senior Software Developer at NearForm and JavaScript enthusiastic.
Full Stack Developer and JavaScript and TypeScript enthusiastic.
Nothing here yet.
Hi Albert Oliva Roura , Thanks. To validate the JSON or you can use the expect directly, like in my example; you can find more on the jest documentation Or you can build your own validation using other libraries like zod, typebox or fluent-json-schema. The official way is by the expect, but I understand is not so simple.
Hi Willy De la Cruz Sierra , thanks for your feedback. I know the doc is not extensive at this moment, unfortunately. I tried to create new examples in this branch , so please take a look there. In a nutshell, the idea is to create small functions that return or do something. Then you can expose them directly as your base test function, or you can create a new one on each test file in base on your tests. For instance, you can create a reusable fixture, if this fixture is required in most of the tests, or create a specific one if the fixture is just for one or two tests in the same file. Let me know if the examples are clear; in case, I'll try to be more exhaustive.