Unit testing. BrightScript. Without a device. Yep, you read that right.
There are two libraries that make the magic happen: brs
and roca
. brs
is an interpreter for the BrightScript language, and roca
is a test runner (think: mocha for BrightScript).
Essentially, the flow is:
- You tell
roca
to find and run your tests. roca
tellsbrs
to parse and interpret all of your source files to create an execution scope that each test will run in.roca
sends each test file tobrs
, which parses/interprets/executes the test.- Based on the asserts in each test,
roca
reports the results in TAP output, which gets automatically parsed and reported back to you in the format of whichever Mocha reporter you choose.
See the Quick start page for a guide to installing and writing your first test case.