@onzag/itemize / Modules / testing/client/explorer / ExplorerText
testing/client/explorer.ExplorerText
Defines a test, and it should be used as an entry for all subtests
-
↳
ExplorerText
- currentTestingContext
- currentTestingContextBuildNumber
- currentTestingContextCookies
- currentTestingContextSSR
- fullHost
- host
- initialPath
- page
- puppet
- testingInfo
- after
- before
- construtor
- define
- describe
- info
- it
- quit
- retrieveTestingInfo
- skipAll
- skipLayer
- skipNext
- step
- wait
- warn
• new ExplorerText(host, fullHost, testingInfo, puppet, initialPath): ExplorerText
| Name | Type |
|---|---|
host |
string |
fullHost |
string |
testingInfo |
ITestingInfoType |
puppet |
Browser |
initialPath |
string |
• Private currentTestingContext: IGlobalTestingType
• Private currentTestingContextBuildNumber: string
• Private currentTestingContextCookies: Cookie[]
• Private currentTestingContextSSR: ISSRContextType
• Private fullHost: string
• Private host: string
• Private initialPath: string
• Private page: Page
• Private puppet: Browser
• Private testingInfo: ITestingInfoType
▸ after(): Promise<void>
Executes after everything is done use for cleanup
Promise<void>
testing/client/explorer.ts:164
▸ before(): Promise<void>
Executes before, override this function it allows you to dinamically add tests as well
Promise<void>
▸ construtor(): void
Build a brand new instance
void
▸ define(label, test?): void
Define a new test
| Name | Type | Default value | Description |
|---|---|---|---|
label |
string |
undefined |
the label for the test |
test |
Test |
null |
the test instance |
void
▸ describe(): Promise<void>
Executes during just after before has been executed
Promise<void>
▸ info(txt): WarnHandle
Provides information during the test
| Name | Type |
|---|---|
txt |
string |
WarnHandle
▸ it(label, fn?): ItHandle
Define a new assertion
| Name | Type | Default value | Description |
|---|---|---|---|
label |
string |
undefined |
the label for the assertion |
fn |
() => void | PromiseLike<void> |
null |
the assetion to execute |
ItHandle
▸ quit(): void
Quits this test
void
▸ retrieveTestingInfo(): Promise<void>
Promise<void>
▸ skipAll(): void
Skips all the following IT tests regardless of layer
void
▸ skipLayer(): void
Skip all the tests that are on the same layer only
because .it and .step can be nested inside others, and they count as their own child layer
void
▸ skipNext(): void
Skip all the next IT tests they should be on the same layer it will not skip what's on a deeper layer
void
▸ step(fn?): ItHandle
Defines a new step, works similar to defining an assertion but it has no label and is just a singular hidden step
| Name | Type | Default value |
|---|---|---|
fn |
() => void | PromiseLike<void> |
null |
ItHandle
▸ wait(ms): Promise<void>
Helper function to wait
| Name | Type |
|---|---|
ms |
number |
Promise<void>
▸ warn(txt): WarnHandle
Warns during the test
| Name | Type |
|---|---|
txt |
string |
WarnHandle