diff --git a/docs/api/reference/globals.md b/docs/api/reference/globals.md index db294ea..18bd7bd 100644 --- a/docs/api/reference/globals.md +++ b/docs/api/reference/globals.md @@ -57,6 +57,7 @@ These extensions are all available on a global associative array called `_brs_`: { getStackTrace: function, global: associative array, + testData: associative array, mockComponent: function, mockComponentPartial: function, mockFunction: function, diff --git a/docs/api/reference/test-utilities.md b/docs/api/reference/test-utilities.md index 7818779..1490e10 100644 --- a/docs/api/reference/test-utilities.md +++ b/docs/api/reference/test-utilities.md @@ -57,6 +57,26 @@ print _brs_.global ------------ +## \_brs_.testData + +A reference to the temporary associative array, so that you can access it from everywhere inside your brs code. Mostly used for saving/accessing some test-specific data. Clears before running each test file. + +### Usage +```brightscript +_brs_.testData._isFooAvailable = false +_brs_.mockFunction("isFooAvailable", sub() + return _brs_.testData._isFooAvailable +end sub) + +isFooAvailable() ' => false + +_brs_.testData._isFooAvailable = true ' something happened and now it is available +isFooAvailable() ' => true +``` +
+ +------------ + # \_brs_.process Allows you to access the command line arguments and locale.