Closed fmichaut-diff closed 1 year ago
:wave: You do get an error if the block is executed:
`it` is not available from within an example (e.g. an `it` block) or from constructs that run in the scope of an example (e.g. `before`, `let`, etc). It is only available on an example group (e.g. a `describe` or `context` block).
But if you have no other specs the block is never executed, which is what happened in your case.
Subject of the issue
Currently, if a
it
block (example block) is defined inside abefore
block, theit
block will never run.Your environment
Steps to reproduce
This will never run, because the
end
of the before is after theit
block. (this is a mistake, and currently no errors are raised so the user believes it is working)Expected behavior
This should raise an error, as much as using
let
in anit
block is an error.Actual behavior
The current behavior silently skips the
it
blocks, and the user might never realise the specs are never run.