-
Notifications
You must be signed in to change notification settings - Fork 778
Description
Story: As a programmer, I want to know how to set up fixtures/test-contexts when writing my tests. (Note on terminology: With "fixture" I mean setting preconditions for several tests, e.g. setting up an object or preparing data to be used in several tests. I do not mean the DOM fixture that QUnit offers)
Current State: There are examples of how to set up a pre-test fixture in the QUnit.module() documentation. However, these are hard to find: Searching for fixture will yield only the DOM fixture, which has no link to test fixtures; the hooks dokumentation mentions (test) fixtures, but does not have an example for it. On the first glance it looks as if I need to understand an powerful, yet somewhat abstract modules and hooks system, however, actually creating a fixture is not very complex.
Desired state: Ideally, a short, worked example in getting started by using the before-each hook for setting up the test context. (maybe with a short explaination on the terminology that QUnit uses "fixture" mainly for the DOM fixture) Without adding such a section, it might be an improvement to link the "using the test context"-Example at the DOM Fixture: For example “If you look for a way to set your test context, i.e. code run before all tests in a module, see "using the test context""