Confirmed users
561
edits
Line 113: | Line 113: | ||
=== Example JS Tests === | === Example JS Tests === | ||
You can run pure JavaScript tests as well. These tests have the appearance of mochitests, with support for the "ok" (which is like assertTrue), "is", "isnot" and "finish" commands. You can indicate whether you want these tests to be run in chrome or content by setting key variables (MARIONETTE_CONTEXT) and you can set the timeout period if the test script is asynchronous (MARIONETTE_TIMEOUT). These keywords must be defined at the top of the file. Here's an example for testing Gaia's AppManager in B2G: | You can run pure JavaScript tests as well. These tests have the appearance of mochitests, with support for the "ok" (which is like assertTrue), "is", "isnot" and "finish" commands. You can indicate whether you want these tests to be run in chrome or content by setting key variables (MARIONETTE_CONTEXT), whether the test is async or synchronous (MARIONETTE_ASYNC), and you can set the timeout period if the test script is asynchronous (MARIONETTE_TIMEOUT). These keywords must be defined at the top of the file. Here's an example for testing Gaia's AppManager in B2G: | ||
<pre> | <pre> |