@onzag/itemize / Modules / testing/server / ServerTest
testing/server.ServerTest
Defines a test, and it should be used as an entry for all subtests
-
↳
ServerTest
• new ServerTest(https, host, port, testingInfo): ServerTest
| Name | Type |
|---|---|
https |
boolean |
host |
string |
port |
string | number |
testingInfo |
ITestingInfoType |
• Private databaseConnection: DatabaseConnection
• Private fullHost: string
• Private host: string
• Private https: boolean
• Private port: string | number
• Private testingInfo: ITestingInfoType
• Private testingUserInfo: IUserInfoAndTokensForTesting
▸ after(): any
Executes after everything is done use for cleanup
any
▸ 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(): void
Executes during just after before has been executed
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
▸ 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