I've noticed that sometimes we wrap the whole test file with a meaningful describe() and sometimes we only call describe() for methods and properties. Wrapping has one major advantage – when running tests in Node.js it's clear what failed. When the test file isn't wrapped, you get some meaningless method/properties names and no context.
So, let's wrap all files. It does not need to be one describe(), because a test file may test multiple subjects, but the most outer describe() calls should always define the subject in a way that it's understandable within the project.
I've noticed that sometimes we wrap the whole test file with a meaningful
describe()
and sometimes we only calldescribe()
for methods and properties. Wrapping has one major advantage – when running tests in Node.js it's clear what failed. When the test file isn't wrapped, you get some meaningless method/properties names and no context.So, let's wrap all files. It does not need to be one
describe()
, because a test file may test multiple subjects, but the most outerdescribe()
calls should always define the subject in a way that it's understandable within the project.