Adonis + Jest status

Hey guys, happy new year!

I have been working with Adonis Vow for a while now and stumbled upon quite a few shortcomings, and a general lack of support that is really becoming an issue. Considering how dominant Jest is becoming I feel like it’d be great to be able to easily use Adonis + Jest to test the backend.

The issue is mainly the IoC container, as the use statements are not regular Javascript, so simply importing Controllers into the Jest tests wouldn’t work. Any ideas on how to do this? Maybe mocking use to require?

Note: I am aware there is a post on this but it’s quite old and I though I’d bring back the discussion.

2 Likes

@virk already wrote a blog long before which clearly mentions why jest is not used.
Link here:

And yeah I believe support for require is coming in AdonisJs 5 which will be helpful to use popular npm packages available with in NodeJs world.

So wait for it.

1 Like

@Karthick-Ramachandra I understand the rationale behind it and why Japa was written but I can’t stand behind that decision.

I worked with Adonis for two years and overall I love it, but I believe it’s not only me that feels this is one of the main things holding it back.

Any chance this decision will get reconsidered / some Jest + Adonis helper supported?

1 Like

AdonisJs 5 will support I believe. As we can see, It supports require in version 5.