A simple testing framework for scripts produced in the jvInterpreter. Inspired by Jasmine.
To install jvTest, simply combine the Edit Scripts folder in the repository with whatever directory is holding the scripts to be executed within your jvInterpreter environment.
As an example, xEdit script developers should combine the Edit Scripts folder with xEdit's Edit Scripts folder.
For other environments, you'll want to make sure you have the jvInterpreter set up properly. See the JEDI Visual Component Library repository on GitHub.
Feel free to check out the example script to get an idea of how to use jvTest.
- Always initialize jvTest before testing with
jvtInitialize; - When you have a group of tests to perform, use the
Describe(string)function to inform the framework that you're in a group of tests. - Wrap all your tests in a try-except block, with
Pass;being the last line of code in the try, andon x: Exception do Fail(x)for the exception handler (you can expand the exception handler for tear-down as necessary). - You can use
Expect(boolean, string)orExpectEqual(Variant, Variant, string)to test results - You can print a report of the tests performed before finalizing jvTest with
jvtPrintReport; - Always finalize jvTest when done testing with
jvtFinalize;