Help:Pickle/FAQ

This tries to answer some of the most common questions. If you have additional questions post them on the discussion page.

What is a spec test?
A spec test is a test written in a style similar to what has become common in RSpec. It focuses on the expected outcome of examples, not a failure to do so. It also focuses on tests that can be written before the code exists, not tests added after everything is finished.

Where do I define spec tests?
Spec tests resides on subpages with the suffix. Usually only one page will hold tests for a single module, but all matching subpages will be included in a test run.

Where are the reports?
Reports from a static test run—those that will be automatically reevaluated on each run—are usually posted as part of the spec docpage. It is not posted on the talk page; that page should only be used for discussion purposes.

How to run tests during editing?
If the module is edited, then there is an additional button under the editor (possibly console). Pushing this will run the found tests, and output the report.

For a test module Pushing the button will only run tests from the current module (spec page). For a source module Pushing the button will run all the tests from the subpage for the current module (source page).

How to run tests from the console?
To run tests from the console you have to some of the background job yourself. This is quite simple, but not similar on the two types of pages. In the test console The special  export variable holds the test module, but the internal require points to the saved source module. If this is correct you can use the following. If that is not sufficient you can use the following where the last table can hold any replacement as key-value pairs where the key is a page otherwise loaded. In the source console The special  export variable holds the source module, but the test modules require points to the saved source module. If this is correct you can use the following. If that is not sufficient you can use the following where the last table can hold any replacement as key-value pairs where the key is a page otherwise loaded.

How to run tests for another locale?
Tests are run for the current user language unless another is explicitly given. You can only do that through the console. The language is the first entry in the function call. In the test console In the source console