|
[createClientForHandler(handler)](/doc/en/lb4/apidocs.testlab.createclientforhandler.html)
|
Create a SuperTest client connected to an HTTP server listening on an ephemeral port and calling `handler` to handle incoming requests.
|
|
[createRestAppClient(app)](/doc/en/lb4/apidocs.testlab.createrestappclient.html)
|
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)](/doc/en/lb4/apidocs.testlab.createstubinstance.html)
|
Creates a new object with the given functions as the prototype and stubs all implemented functions.
Note: The given constructor function is not invoked. See also the stub API.
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
|
|
[createUnexpectedHttpErrorLogger(expectedStatusCode)](/doc/en/lb4/apidocs.testlab.createunexpectedhttperrorlogger.html)
|
Creates a Logger that logs an Error if the HTTP status code is not expected
|
|
[givenHttpServerConfig(customConfig)](/doc/en/lb4/apidocs.testlab.givenhttpserverconfig.html)
|
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)](/doc/en/lb4/apidocs.testlab.httpgetasync.html)
|
Async wrapper for making HTTP GET requests
|
|
[httpsGetAsync(urlString, agent)](/doc/en/lb4/apidocs.testlab.httpsgetasync.html)
|
Async wrapper for making HTTPS GET requests
|
|
[inject(dispatchFunc, options)](/doc/en/lb4/apidocs.testlab.inject.html)
|
|
|
[skipIf(skip, verb, name, args)](/doc/en/lb4/apidocs.testlab.skipif.html)
|
Helper function for skipping tests when a certain condition is met.
|
|
[skipOnTravis(verb, name, args)](/doc/en/lb4/apidocs.testlab.skipontravis.html)
|
Helper function for skipping tests on Travis CI.
|
|
[stubExpressContext(requestOptions)](/doc/en/lb4/apidocs.testlab.stubexpresscontext.html)
|
|
|
[stubHandlerContext(requestOptions)](/doc/en/lb4/apidocs.testlab.stubhandlercontext.html)
|
|
|
[stubServerRequest(options)](/doc/en/lb4/apidocs.testlab.stubserverrequest.html)
|
|
|
[stubServerResponse(request, onEnd)](/doc/en/lb4/apidocs.testlab.stubserverresponse.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson_9.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson_10.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson_11.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson_12.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson_13.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson_14.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson_1.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson_2.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson_3.html)
|
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)](/doc/en/lb4/apidocs.testlab.tojson_4.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson_5.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson_6.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson_7.html)
|
|
|
[toJSON(value)](/doc/en/lb4/apidocs.testlab.tojson_8.html)
|
|
|
[validateApiSpec(spec)](/doc/en/lb4/apidocs.testlab.validateapispec.html)
|
|