Corrected testing code scope

Now all code runs inside of `it()` or `before()` functions