new Suite(name [, options])
[private] Suite will be created by testSuite creator.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
name |
string | Suite name |
|
options |
object |
<optional> |
Suite options |
- Source:
- Suite.js
Properties:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
options.serverEntry |
string |
<optional> |
"../../src/index.js" | The entry file of @genx/server instance. |
options.verbose |
boolean |
<optional> |
false | Verbose mode. |
Methods
-
attachObject(name, obj)
-
Attach an object to the test report.
Parameters:
Name Type Description name
string obj
* - Source:
- Suite.js
-
<async> benchmark_(mapOfMethods, payload)
-
Run benchmark against given methods.
Parameters:
Name Type Description mapOfMethods
* Map of name to function with payload
payload
* - Source:
- Suite.js
-
<async> startRestClient_(serviceName [, authenticator], testToRun [, options])
-
Start a rest client for testing
Parameters:
Name Type Argument Description serviceName
string The config key of target endpoint
authenticator
function | string <optional>
Authenticator to be used, async (client) => {}, or pass a userTag to use default authenticator.
testToRun
testWithRestClient Test function with a connected rest client.
options
* <optional>
Options passed the test worker, see startWorker of @genx/app.
- Source:
- Suite.js
-
<async> startWorker_(testToRun, options)
-
Start a worker app for testing
Parameters:
Name Type Description testToRun
testWithRestClient Test function with a connected rest client.
options
* Options passed the test worker, see startWorker of @genx/app.
- Source:
- Suite.js
-
testCase(story, body [, options])
-
Define a test case.
Parameters:
Name Type Argument Description story
string Test case title.
body
testCaseBody Test case body to write actual test code.
options
object <optional>
- Source:
- Suite.js
Properties:
Name Type Description options.data
* Test data
options.cleanUp
function Cleanup after the case ends regardless whether it is successful or not.
-
testCaseFromFixtures(story, body [, options])
-
Test case with fixtures.
Parameters:
Name Type Argument Description story
string body
testCaseBody options
Object <optional>
- Source:
- Suite.js
-
<async> testStep_(step [, body])
-
Define a test step.
Parameters:
Name Type Argument Description step
string body
function <optional>
Test step body
- Source:
- Suite.js