-
Notifications
You must be signed in to change notification settings - Fork 9
Test And TestSuite Options
Daniel Cleaton edited this page Feb 5, 2025
·
1 revision
To apply specific options to a test, test suite, or the entire framework run, it is necessary to provide the relevant configuration during the creation of each entity.
When configuring options for a test, the configuration should be provided during its creation. On the other hand, for test suites, the configuration must be provided within the constructor body of the given test suite.
Examples of these configurations are shown below:
function MyTestSuite() : TestSuite() constructor {
addFact("a fact test description (unique name is recommended)", function() {
// This is your test code!
assert_equals(5, 5, "Two equal number literals should be equal!") // This assert will pass
}, {
// NOTES:
// * These options will be applied to the current test.
// * These options will overwrite any of the defaults being applied.
// * The 'test_filter' expects a predicate function that will filter execution (there are are already some 'platform_*' functions to help on that)
// * The 'test_timeout_millis' is used mostly for async tests and will terminate the test after the given amount of time with an 'expired' result
test_filter: platform_desktop,
test_timeout_millis: 1000,
});
// NOTES
// * These options will be applied to the current suite.
// * These options will overwrite any of the defaults being applied.
// * The 'suite_filter' expects a predicate function that will filter execution (there are are already some 'platform_*' functions to help on that)
// * The 'suite_timeout_millis' will terminate the suite after the given amount of time with an 'expired' result
// * The 'suite_bail_on_fail' will bail out of suite execution upon the first failed test
// * The 'suite_delay_seconds' will allow for a time gap between tests inside the test suite.
config({
suite_filter: platform_desktop,
suite_timeout_millis: 1000,
suite_bail_on_fail: true,
suite_delay_seconds: 0.100
})
}