Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Example/Documentation for pre-test fixtures #1805

Open
jdittrich opened this issue Jan 16, 2025 · 0 comments
Open

Documentation: Example/Documentation for pre-test fixtures #1805

jdittrich opened this issue Jan 16, 2025 · 0 comments
Labels
Category: Docs Type: Enhancement New idea or feature request.

Comments

@jdittrich
Copy link

jdittrich commented Jan 16, 2025

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""

@jdittrich jdittrich changed the title Example/Documentation for pre-test fixtures Documentation: Example/Documentation for pre-test fixtures Jan 16, 2025
@Krinkle Krinkle added Type: Enhancement New idea or feature request. Category: Docs labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Docs Type: Enhancement New idea or feature request.
Development

No branches or pull requests

2 participants