Wednesday 22 April 2020

Testing in AdonisJS

So, I work with adonis, and our tests are kind of a mess. They don't take advantage of transactions to clean up after each test, nor do they use any of the builtin traits. Documentation seems sparse on the subject, so what im looking for is tips and tricks for working with tests in adonis, if anyone out there has experience with it.Specifically, what Id like right now is to know the correct way of setting up a few default objects in our database before running a bunch of tests (we currently use the before and after hooks for this, but Im kinda sure there is a better option). Is setting up a Trait the way to do it? Attach the created stuff to the Context?

Submitted April 22, 2020 at 07:27PM by JulioCaye

No comments:

Post a Comment