createClientForHandler(handler) |
Create a SuperTest client connected to an HTTP server listening on an ephemeral port and calling handler to handle incoming requests. |
createRestAppClient(app) |
Create a SuperTest client for a running RestApplication instance. It is the responsibility of the caller to ensure that the app is running and to stop the application after all tests are done. |
createStubInstance(constructor) |
<p>Creates a new object with the given functions as the prototype and stubs all implemented functions.</p><p>Note: The given constructor function is not invoked. See also the stub API.</p><p>This is a helper method replacing sinon.createStubInstance and working around the limitations of TypeScript and Sinon, where Sinon is not able to list private/protected members in the type definition of the stub instance and therefore the stub instance cannot be assigned to places expecting TType. See also - https://github.com/Microsoft/TypeScript/issues/13543 - https://github.com/DefinitelyTyped/DefinitelyTyped/issues/14811</p> |
createUnexpectedHttpErrorLogger(expectedStatusCode) |
Creates a Logger that logs an Error if the HTTP status code is not expected |
givenHttpServerConfig(customConfig) |
Create an HTTP-server configuration that works well in test environments. - Ask the operating system to assign a free (ephemeral) port. - Use IPv4 localhost 127.0.0.1 to avoid known IPv6 issues in Docker-based environments like Travis-CI. - Provide default TLS key & cert when protocol is set to https . |
httpGetAsync(urlString, agent) |
Async wrapper for making HTTP GET requests |
httpsGetAsync(urlString, agent) |
Async wrapper for making HTTPS GET requests |
inject(dispatchFunc, options) |
|
skipIf(skip, verb, name, args) |
Helper function for skipping tests when a certain condition is met. |
skipOnTravis(verb, name, args) |
Helper function for skipping tests on Travis CI. |
stubExpressContext(requestOptions) |
|
stubHandlerContext(requestOptions) |
|
stubServerRequest(options) |
|
stubServerResponse(request, onEnd) |
|
toJSON(value) |
|
toJSON(value) |
|
toJSON(value) |
|
toJSON(value) |
|
toJSON(value) |
|
toJSON(value) |
|
toJSON(value) |
|
toJSON(value) |
|
toJSON(value) |
|
toJSON(value) |
JSON encoding does not preserve properties that are undefined As a result, deepEqual checks fail because the expected model value contains these undefined property values, while the actual result returned by REST API does not. Use this function to convert a model instance into a data object as returned by REST API |
toJSON(value) |
|
toJSON(value) |
|
toJSON(value) |
|
toJSON(value) |
|
toJSON(value) |
|
validateApiSpec(spec) |
|