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
Resets the world to a blank state with no entities.
WARNING: This will permanently delete every entity in your world (scenes, actors, items, macros, roll tables, journal entries, playlists, chat messages, folders, etc.)
Pauses execution for the given number of milliseconds
duration to pause for in milliseconds
A Promise
that is resolved when the given time passed
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.
Running all batches
quench.runBatches(); // or
quench.runBatches("**");
Running a single batch
quench.runBatches("quench.examples.basic-pass");
Running multiple batches
quench.runBatches(["quench.examples.basic-pass", "quench.examples.basic-fail"]);
quench.runBatches("quench.examples.*"); // Will run "quench.examples.basic-pass", but not "quench.complex.basic-pass"
Running all batches belonging to Quench
quench.runBatches("quench.**"); // or
quench.runBatches(["quench.**"]);
Generated using TypeDoc
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.