sjbarag / brs

An interpreter for the BrightScript language that runs on non-Roku platforms.
MIT License
114 stars 43 forks source link

Support `_brs_.testData` #623

Closed lkipke closed 3 years ago

lkipke commented 3 years ago

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's m.addContext.

Let's add a property called _brs_.testData for this purpose.