TestCase Interface
veve / TestCase
Class: TestCase
Defined in: framework/TestCase.ts:326
Constructors
new TestCase()
new TestCase(
description
):TestCase
Defined in: framework/TestCase.ts:523
Parameters
description
string
Returns
Properties
description
description:
string
Defined in: framework/TestCase.ts:511
hooks
hooks:
object
Defined in: framework/TestCase.ts:516
afterAll?
optional
afterAll:Hook
afterEach?
optional
afterEach:Hook
beforeAll?
optional
beforeAll:Hook
beforeEach?
optional
beforeEach:Hook
onlyTests
onlyTests:
Test
[]
Defined in: framework/TestCase.ts:515
sequenceOnlyTests
sequenceOnlyTests:
Test
[]
Defined in: framework/TestCase.ts:514
sequenceTests
sequenceTests:
Test
[]
Defined in: framework/TestCase.ts:513
tests
tests:
Test
[]
Defined in: framework/TestCase.ts:512
Methods
afterAll()
Call Signature
afterAll(
fn
,options
?):void
Defined in: framework/TestCase.ts:475
Adds an 'afterAll' hook to the test case.
Parameters
fn
HookFunction
The hook function.
options?
Partial
<Options
>
Additional options.
Returns
void
Call Signature
afterAll(
fn
,options
?):void
Defined in: framework/TestCase.ts:694
Adds an 'afterAll' hook to the test case.
Parameters
fn
HookFunction
The hook function.
options?
Partial
<Options
>
Additional options.
Returns
void
afterEach()
Call Signature
afterEach(
fn
,options
?):void
Defined in: framework/TestCase.ts:482
Adds an 'afterEach' hook to the test case.
Parameters
fn
HookFunction
The hook function.
options?
Partial
<Options
>
Additional options.
Returns
void
Call Signature
afterEach(
fn
,options
?):void
Defined in: framework/TestCase.ts:703
Adds an 'afterEach' hook to the test case.
Parameters
fn
HookFunction
The hook function.
options?
Partial
<Options
>
Additional options.
Returns
void
beforeAll()
Call Signature
beforeAll(
fn
,options
?):void
Defined in: framework/TestCase.ts:461
Adds a 'beforeAll' hook to the test case.
Parameters
fn
HookFunction
The hook function.
options?
Partial
<Options
>
Additional options.
Returns
void
Call Signature
beforeAll(
fn
,options
?):void
Defined in: framework/TestCase.ts:676
Adds a 'beforeAll' hook to the test case.
Parameters
fn
HookFunction
The hook function.
options?
Partial
<Options
>
Additional options.
Returns
void
beforeEach()
Call Signature
beforeEach(
fn
,options
?):void
Defined in: framework/TestCase.ts:468
Adds a 'beforeEach' hook to the test case.
Parameters
fn
HookFunction
The hook function.
options?
Partial
<Options
>
Additional options.
Returns
void
Call Signature
beforeEach(
fn
,options
?):void
Defined in: framework/TestCase.ts:685
Adds a 'beforeEach' hook to the test case.
Parameters
fn
HookFunction
The hook function.
options?
Partial
<Options
>
Additional options.
Returns
void
bench()
Call Signature
bench(
description
,fn
,options
?):void
Defined in: framework/TestCase.ts:339
Defines a benchmark test.
Parameters
description
string
The description of the test.
fn
TestFunction
The function to benchmark.
options?
Partial
<Options
>
Additional test options.
Returns
void
Call Signature
bench(
description
,fn
,options
?):void
Defined in: framework/TestCase.ts:536
Defines a benchmark test.
Parameters
description
string
The description of the test.
fn
TestFunction
The function to benchmark.
options?
Partial
<Options
>
Additional test options.
Returns
void
each()
Call Signature
each(
table
,description
,fn
,options
?):void
Defined in: framework/TestCase.ts:352
Defines a parameterized test for each entry in the provided table.
Parameters
table
any
[]
An array of test data.
description
string
The description template.
fn
(...args
) => void
| Promise
<void
>
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
Call Signature
each(
table
,description
,fn
,options
?):void
Defined in: framework/TestCase.ts:547
Defines a parameterized test for each entry in the provided table.
Parameters
table
any
[]
An array of test data.
description
string
The description template.
fn
(...args
) => void
| Promise
<void
>
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
fail()
Call Signature
fail(
description
,fn
,options
?):void
Defined in: framework/TestCase.ts:438
Marks a test to allow soft failures.
Parameters
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
Call Signature
fail(
description
,fn
,options
?):void
Defined in: framework/TestCase.ts:636
Marks a test to allow soft failures.
Parameters
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
it()
Call Signature
it(
description
,fn
,options
?):void
Defined in: framework/TestCase.ts:365
Defines a standard test.
Parameters
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
Call Signature
it(
description
,fn
,options
?):void
Defined in: framework/TestCase.ts:561
Defines a standard test.
Parameters
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
itIf()
Call Signature
itIf(
condition
,description
,fn
,options
?):void
Defined in: framework/TestCase.ts:421
Conditionally runs a test if the condition is met.
Parameters
condition
A boolean or function returning a boolean.
undefined
| null
| boolean
| () => undefined
| null
| boolean
| Promise
<boolean
>
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
Call Signature
itIf(
condition
,description
,fn
,options
?):void
Defined in: framework/TestCase.ts:620
Conditionally runs a test if the condition is met.
Parameters
condition
A boolean or function returning a boolean.
undefined
| null
| boolean
| () => undefined
| null
| boolean
| Promise
<boolean
>
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
only()
Call Signature
only(
description
,fn
,options
?):void
Defined in: framework/TestCase.ts:446
Marks a test to run exclusively.
Parameters
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
Call Signature
only(
description
,fn
,options
?):void
Defined in: framework/TestCase.ts:648
Marks a test to run exclusively.
Parameters
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
retry()
Call Signature
retry(
retry
,description
,fn
,options
?):void
Defined in: framework/TestCase.ts:386
Defines a test with retry logic.
Parameters
retry
number
The number of retries.
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
Call Signature
retry(
retry
,description
,fn
,options
?):void
Defined in: framework/TestCase.ts:587
Defines a test with retry logic.
Parameters
retry
number
= 0
The number of retries.
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
run()
Call Signature
run():
Promise
<TestReport
>
Defined in: framework/TestCase.ts:488
Runs the test case and returns a test report.
Returns
Promise
<TestReport
>
The test report after execution.
Call Signature
run():
Promise
<TestReport
>
Defined in: framework/TestCase.ts:711
Runs the test case and returns a test report.
Returns
Promise
<TestReport
>
The test report after execution.
sequence()
Call Signature
sequence(
description
,fn
,options
?):void
Defined in: framework/TestCase.ts:373
Defines a test to run in sequence.
Parameters
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
Call Signature
sequence(
description
,fn
,options
?):void
Defined in: framework/TestCase.ts:575
Defines a test to run in sequence.
Parameters
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
should()
Call Signature
should(
description
):void
Defined in: framework/TestCase.ts:331
Updates the description of the test case.
Parameters
description
string
The new description for the test case.
Returns
void
Call Signature
should(
description
):void
Defined in: framework/TestCase.ts:532
Updates the description of the test case.
Parameters
description
string
The new description for the test case.
Returns
void
skip()
Call Signature
skip(
description
,fn
,options
?):void
Defined in: framework/TestCase.ts:454
Skips a test.
Parameters
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
Call Signature
skip(
description
,fn
,options
?):void
Defined in: framework/TestCase.ts:664
Skips a test.
Parameters
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
timeout()
Call Signature
timeout(
timeout
,description
,fn
,options
?):void
Defined in: framework/TestCase.ts:400
Defines a test with a timeout.
Parameters
timeout
number
The timeout in milliseconds.
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
Call Signature
timeout(
timeout
,description
,fn
,options
?):void
Defined in: framework/TestCase.ts:599
Defines a test with a timeout.
Parameters
timeout
number
= 0
The timeout in milliseconds.
description
string
The description of the test.
fn
TestFunction
The test function.
options?
Partial
<Options
>
Additional test options.
Returns
void
todo()
Call Signature
todo(
description
,options
?):void
Defined in: framework/TestCase.ts:412
Adds a todo test.
Parameters
description
string
The description of the test.
options?
Partial
<Options
>
Additional test options.
Returns
void
Call Signature
todo(
description
,options
?):void
Defined in: framework/TestCase.ts:611
Adds a todo test.
Parameters
description
string
The description of the test.
options?
Partial
<Options
>
Additional test options.
Returns
void