vendredi 20 juillet 2018

JavaScript test (mocha) code organization

I want to ask how to organize my code. I write a JavaScript test using Mocha. In my project I have folder named “helpers” and we can find there files with exports modules like “back_to_main_menu”, “go_Offline”, “”go_Online” etc. And I have another folder where we can find files with single test. Every code in this files starts with a lot of lines which looks 
like 


const {someFunction} = require(‘../helpers/someFunction’)


I want to ask you how to organize it better and avoid this many lines of code in every test file. I don’t want to put all the helpers functions in one file, because I want to keep quick overview of the names of functions.

Aucun commentaire:

Enregistrer un commentaire