vendredi 26 mai 2017

What is the best approach to test a HapiJS plugin, with Lab?

What is the best way to test a HapiJS plugin, for example one plugin that add routes and handlers.

Since I have to create an instance of Hapi.Server to run the plugins, should I define all the tests from the app's root, for all the plugins ?

or

should I manage to get THE instance of Hapi.Server in my plugin's local tests ?

If I go for the second option, my server will have registered all the plugins, including those that the plugin to be tested doesn't depends on.

What is the best way to approach this ?

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire