Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Latest commit

 

History

History
33 lines (26 loc) · 1.3 KB

seed.md

File metadata and controls

33 lines (26 loc) · 1.3 KB
layout title excerpt groups redirect_from version_added
page-api
QUnit.config.seed
Enable randomized ordering of tests.
config
/config/seed/
1.23.0

Enable randomized ordering of tests.

type `string` or `boolean` or `undefined`
default `undefined`

This option is also available as [CLI option](../../cli.md), and as URL query parameter in the browser.

When set to boolean true, or a string, QUnit will run tests in a seeded-random order.

The provided string will be used as the seed in a pseudo-random number generator to ensure that results are reproducible. The randomization will also respect the reorder option if enabled and re-run failed tests first without randomizing them.

Randomly ordering your tests can help identify non-atomic tests which either depend on a previous test or are leaking state to subsequent tests.

If seed is boolean true (or set as URL query parameter without a value), then QUnit will generate on-demand a new random value to use as seed. You can then read the seed at runtime from the configuration value, and use it to reproduce the same test sequence later.