Optional context: anyOptional testFunction: AftTestFunctionOptional options: AftTestOptionsReadonly descriptionReadonly testan instance of a Vitest.Context from the ctx context
passed to a Vitest it function as an argument
ctx
if no
ctxargument is passed to youritfunction this will not be available
a BuildInfoManager instance used to generate
a Build Number and Build Name from the first loaded
BuildInfoPlugin
returns the amount of time, in milliseconds, elapsed since the AftTest was
started either by calling the run function or using aftTest(description, testFunction, options) helper function until it ended or now if not yet
done
NOTE
this includes the time taken to query any
PolicyPlugininstances
a PolicyManager instance used to determine if
this AftTest should run by querying all loaded
PolicyPlugin instances
a ReportingManager that uses the description property
of this AftTest as the name or the
ReportingManager passed in via AftTestOptions
returns an array of TestResult objects for each result already submitted
via a call to verify, pass, fail or pending or the completion of
the testFunction execution within the run function
one result is submitted for each associated Test ID or just one overall result if no Test IDs are associated with this instance if
withFileSystemCacheis enabled this includes searching the filesystem cache for any logged test results for theAftTest.descriptionand returning the results as an array ofTestResultobjects with each object corresponding to a Test ID referenced in the test name
an array of TestResult objects where each entry corresponds to
a referenced Test ID parsed from the AftTest.description
returns the overall status of this AftTest. this value is only updated when
a AftTest.fail(...) call is made or a AftTest.verify(actual, expected) check
fails or when the test completes without error. otherwise the value will be
'untested'
an array of string values representing the associated test IDs for
this AftTest. for each test ID a unique result can and will be reported
during or on the completion of running the testFunction
ex: ["C1234", "C2345"]
Protected _doneProtected _generateProtected _generateProtected _logProtected _parseProtected _startedProtected _submitProtected _submitProtected _testexecutes any 'fail' event actions after submitting
a 'failed' result for each associated test ID and then
throws a AftTestFailError to halt execution of the
testFunction (if running)
Optional message: stringan optional message to describe why the test
is being marked as 'failed'
"unknown error occurred"
this function handles event actions and checking the PolicyManager to
determine if the supplied testFunction should be run. immediately prior
to executing the testFunction the _started function is called
followed by execution of the testFunction and then calling _done
NOTE
if using the
aftTesthelper function thenrunis automatically called, otherwise it must manually be called to run thetestFunction
this AftTest instance
performs a comparison of an actual and expected result. by default any error
will result in halting the execution of the AftTest and reporting a failure,
but by setting the haltOnVerifyFailure option to false you can allow the
test execution to continue and only report the failure at the completion of running
the testFunction
ex:
// no message and continues on verify failure
await aftTest('continue on failure', async (v: AftTest) => {
await v.verify(true, false);
// below will run because "haltOnVerifyFailure" is "false"
// but overall status will be 'failed' because above
// call fails
await v.verify(true, true);
}, {haltOnVerifyFailure: false});
// message with test ID (failure)
await aftTest('[C1234] error on failure', async (v: AftTest) => {
// submits `TestResult` for test ID `C1234` with `status='failed'`
// and `message="C1234 - expected 'false' to be 'true'"`
await v.verify(true, false, '[C1234]');
});
// message with test ID (success)
await aftTest('[C1234] successful test', async (v: AftTest) => {
// submits `TestResult` for test ID `C1234` with `status='passed'`
await v.verify(true, true, '[C1234]');
});
the actual result from some action
the expected result from the action
Optional message: stringan optional message to include before any error string
when a failure occurs. this may also include any test ID(s) in the form
"...[TestID]..." and if included will result in a call to pass or fail
with the associated test ID(s)
a ProcessingResult<boolean> where ProcessingResult.result === true
equates to success and ProcessingResult.result !== true equates to failure.
if a
messageargument is passed to theverifycall then it will be included in themessageproperty of the returnedProcessingResult
Generated using TypeDoc
expects to be passed the context from an executing Vitest task (i.e. the
ctxargument)NOTE:
Param
the
ctxcontext object passed to a Vitestit