dimanche 17 décembre 2017

How to test yeoman generator without config

My goal here is to cover all the lines of my Yeoman generator.

When I use values from the config, the test always return them like if it is set.
This is not the case when I test manually the generator with npm link.

I would like to know how do I cover these cases in particular :

prompt1.default = this.config.get('author') || this.user.git.name();
prompt2.default = this.config.get('something') || 'Default prompt value';

The values on the right side of the condition are not covered.

Is there something to set with the helpers module ?
Thanks.

Aucun commentaire:

Enregistrer un commentaire