Oftentimes when mocking components/functions, it can be helpful to use a globally-scoped (or maybe it'd be scopeless? 🤔) variable that is accessible both from the mock and the test case/suite. Since the mock runs in the source code's m scope, this isn't possible with roca's m.addContext.
Let's add a property called _brs_.testData for this purpose.
Summary
Oftentimes when mocking components/functions, it can be helpful to use a globally-scoped (or maybe it'd be scopeless? 🤔) variable that is accessible both from the mock and the test case/suite. Since the mock runs in the source code's
m
scope, this isn't possible with roca'sm.addContext
.Let's add a property called
_brs_.testData
for this purpose.