How to organize my specification files?

I use mocha to test my node.js. application

I notice that my specifications become more and more with time. Is there any template for organizing test files (for example, one specification file for each test)? Or is there another mocha framework to help me structure my tests? Or do you prefer other test frames for this reason?

+5
source share
1 answer

Large test / specification files tend to mean that the code under test may work too much. This is not always the case, but often your test code will always weigh the code you are testing, but if it’s hard for you to deal with this, it may be familiar.

. , example.js, example.tests.js .

ExampleSpec /, . , EmptyExample, ErrorExample DefaultExample, . , , . , , ​​:

    specs/
        Example/
            EmptyExample.js
            ErrorExample.js
            DefaultExample.js

, / . .

+1

All Articles