Readonly
chaiChai's static object
Readonly
fcfast-check for property based testing
Readonly
mochaMocha's browser global
An object holding reports generated by the last run.
Readonly
utilsVarious utility functions
Aborts the currently running tests, if tests are currently running. Does nothing if no tests are currently running. This will not cancel an in progress test. The run will abort after the currently running test completes.
Registers a new Quench test batch which will show up in the quench window to be enabled/disabled and run.
Suites and tests within a Quench test batch are not actually registered in the mocha runner until the user initiates the test run
with runBatches. When runBatches
is executed, the provided batches' registration functions
are run and then the tests are executed.
The registration function is passed a context
argument, which contains the mocha and chai methods necessary for defining a test.
describe
, it
, after
, afterEach
, before
, beforeEach
, and utils
.assert
, expect
, and should
; the last one is also made available by extending Object.prototype
.fc
The test batch's unique string key. Only one test batch with a given key can exist at one time. If you register a test batch with a pre-existing key, it will overwrite the previous test batch.
The function which will be called to register the suites and tests within your test batch.
Additional options affecting Quench's handling of this batch.
quench.registerBatch(
"quench.examples.basic-pass",
(context) => {
const { describe, it, assert } = context;
describe("Passing Suite", function () {
it("Passing Test", function () {
assert.ok(true);
});
});
},
{
displayName: "QUENCH: Basic Passing Test",
preSelected: true,
snapBaseDir: "quench",
},
);
Runs the test batches defined by the keys in their registration.
The contents of the test batches are registered with mocha when this function is executed.
Optional
keys: string | string[] = "**"A single batch key or an array of batch keys to run.
Simple wildcards are supported:
?
matches one arbitrary character, excluding the separator .
*
matches zero or more arbitrary characters, excluding the separator .
**
matches zero or more arbitrary characters, including the separator .
Optional
options: QuenchRunBatchOptions = {}Additional options affecting this batch run
Returns the mocha Runner object for this test run.
The
Quench
class is the "hub" of the Quench module. It contains the primary public API for Quench, as well as references to the global mocha and chai objects.