Skip to main content

HotTesterMocha

hotstaq / Modules / HotTesterMocha

Class: HotTesterMocha

The tester that uses Mocha to executes all tests.

Hierarchy​

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new HotTesterMocha(processor, name, baseUrl, driver, testMaps?, beforeAll?, afterAll?)

Parameters​

NameTypeDefault value
processorHotStaqundefined
namestringundefined
baseUrlstringundefined
driverHotTestDriverundefined
testMapsObject{}
beforeAll() => Promise<void>null
afterAll() => Promise<void>null

Overrides​

HotTester.constructor

Defined in​

HotTesterMocha.ts:35

Properties​

afterAll​

• afterAll: () => Promise<void>

Type declaration​

â–¸ (): Promise<void>

The Mocha afterAll event to call before any tests are executed.

Returns​

Promise<void>

Defined in​

HotTesterMocha.ts:33


baseUrl​

• baseUrl: string

The base url that will construct future urls.

Inherited from​

HotTester.baseUrl

Defined in​

HotTester.ts:74


beforeAll​

• beforeAll: () => Promise<void>

Type declaration​

â–¸ (): Promise<void>

The Mocha beforeAll event to call before any tests are executed.

Returns​

Promise<void>

Defined in​

HotTesterMocha.ts:29


driver​

• driver: HotTestDriver

The driver to use when running tests.

Inherited from​

HotTester.driver

Defined in​

HotTester.ts:86


finishedLoading​

• finishedLoading: boolean

Has this tester finished loading?

Inherited from​

HotTester.finishedLoading

Defined in​

HotTester.ts:90


hasBeenDestroyed​

• hasBeenDestroyed: boolean

Has this tester finished setting up?

Inherited from​

HotTester.hasBeenDestroyed

Defined in​

HotTester.ts:98


hasBeenSetup​

• hasBeenSetup: boolean

Has this tester finished setting up?

Inherited from​

HotTester.hasBeenSetup

Defined in​

HotTester.ts:94


mocha​

• mocha: Mocha

The mocha instance to run.

Defined in​

HotTesterMocha.ts:17


name​

• name: string

The tester name.

Inherited from​

HotTester.name

Defined in​

HotTester.ts:70


processor​

• processor: HotStaq

The associated processor.

Inherited from​

HotTester.processor

Defined in​

HotTester.ts:78


suite​

• suite: Suite

The suite to execute.

Defined in​

HotTesterMocha.ts:25


testMaps​

• testMaps: Object

The test maps to test.

Index signature​

â–ª [name: string]: HotTestMap

Inherited from​

HotTester.testMaps

Defined in​

HotTester.ts:82


timeout​

• timeout: number

The timeout for each test.

Defined in​

HotTesterMocha.ts:21

Methods​

destroy​

â–¸ destroy(): Promise<void>

Executed when destroying up the tester.

Returns​

Promise<void>

Overrides​

HotTester.destroy

Defined in​

HotTesterMocha.ts:58


execute​

â–¸ execute(mapName): Promise<void>

Execute the tests.

Parameters​

NameType
mapNamestring

Returns​

Promise<void>

Inherited from​

HotTester.execute

Defined in​

HotTester.ts:561


executeCommand​

â–¸ executeCommand(destination, page, stop, cmd): Promise<void>

Execute a command.

Parameters​

NameType
destinationHotDestination
pageHotTestPage
stopHotTestStop
cmdstring

Returns​

Promise<void>

Inherited from​

HotTester.executeCommand

Defined in​

HotTester.ts:380


executeTestAPIPath​

â–¸ executeTestAPIPath(destination, method, testName, skipEventCalls?, continueWhenTestIsComplete?): Promise<any>

Execute an API's test path.

Parameters​

NameTypeDefault value
destinationHotDestinationundefined
methodHotRouteMethodundefined
testNamestringundefined
skipEventCallsbooleanfalse
continueWhenTestIsCompletebooleanfalse

Returns​

Promise<any>

Inherited from​

HotTester.executeTestAPIPath

Defined in​

HotTester.ts:256


executeTestAPIPaths​

â–¸ executeTestAPIPaths(destination): Promise<any[]>

Execute all test paths in an API route.

fixme This needs a better implementation...

Parameters​

NameType
destinationHotDestination

Returns​

Promise<any[]>

Inherited from​

HotTester.executeTestAPIPaths

Defined in​

HotTester.ts:294


executeTestPagePath​

â–¸ executeTestPagePath(destination, stop, skipEventCalls?, continueWhenTestIsComplete?): Promise<any>

Execute a test page path.

Parameters​

NameTypeDefault value
destinationHotDestinationundefined
stopHotTestStopundefined
skipEventCallsbooleanfalse
continueWhenTestIsCompletebooleanfalse

Returns​

Promise<any>

Inherited from​

HotTester.executeTestPagePath

Defined in​

HotTester.ts:329


executeTestPagePaths​

â–¸ executeTestPagePaths(destination, continueWhenTestIsComplete?): Promise<any[]>

Execute all test paths in a page.

Parameters​

NameTypeDefault value
destinationHotDestinationundefined
continueWhenTestIsCompletebooleanfalse

Returns​

Promise<any[]>

Inherited from​

HotTester.executeTestPagePaths

Defined in​

HotTester.ts:515


getTestPage​

â–¸ getTestPage(destination): HotTestPage

Get a test page.

Parameters​

NameType
destinationHotDestination

Returns​

HotTestPage

Inherited from​

HotTester.getTestPage

Defined in​

HotTester.ts:181


getTestPath​

â–¸ getTestPath(destination, pathName): HotTestPath

Get a test path.

Parameters​

NameType
destinationHotDestination
pathNamestring

Returns​

HotTestPath

Inherited from​

HotTester.getTestPath

Defined in​

HotTester.ts:191


onCommand​

â–¸ onCommand(destination, page, stop, cmd, args, cmdFunc): Promise<void>

Executed when a command is executed.

Parameters​

NameType
destinationHotDestination
pageHotTestPage
stopHotTestStop
cmdstring
argsstring[]
cmdFunc(cmdArgs: string[]) => Promise<void>

Returns​

Promise<void>

Overrides​

HotTester.onCommand

Defined in​

HotTesterMocha.ts:111


onExecute​

â–¸ Optional onExecute(): Promise<void>

Executed when this tester has been executed from the API.

Returns​

Promise<void>

Inherited from​

HotTester.onExecute

Defined in​

HotTester.ts:163


onFinishedLoading​

â–¸ Optional onFinishedLoading(): Promise<void>

Executed when this tester has finished loading all data from the API.

Returns​

Promise<void>

Inherited from​

HotTester.onFinishedLoading

Defined in​

HotTester.ts:167


onTestAPIPathEnd​

â–¸ Optional onTestAPIPathEnd(destination, method, testName, result, continueWhenTestIsComplete?): Promise<void>

Executed when an API test path has ended.

Parameters​

NameType
destinationHotDestination
methodHotRouteMethod
testNamestring
resultany
continueWhenTestIsComplete?boolean

Returns​

Promise<void>

Inherited from​

HotTester.onTestAPIPathEnd

Defined in​

HotTester.ts:137


onTestAPIPathStart​

â–¸ Optional onTestAPIPathStart(destination, method, testName, continueWhenTestIsComplete?): Promise<boolean>

Executed when an API test path has started. If this returns false, the testPath will not be immediately executed afterwards.

Parameters​

NameType
destinationHotDestination
methodHotRouteMethod
testNamestring
continueWhenTestIsComplete?boolean

Returns​

Promise<boolean>

Inherited from​

HotTester.onTestAPIPathStart

Defined in​

HotTester.ts:132


onTestEnd​

â–¸ onTestEnd(destination): Promise<void>

Executed when tests are finished.

Parameters​

NameType
destinationHotDestination

Returns​

Promise<void>

Overrides​

HotTester.onTestEnd

Defined in​

HotTesterMocha.ts:120


onTestPagePathEnd​

â–¸ Optional onTestPagePathEnd(destination, testPath, result, continueWhenTestIsComplete?): Promise<void>

Executed when a page test has ended.

Parameters​

NameType
destinationHotDestination
testPathHotTestPath
resultany
continueWhenTestIsComplete?boolean

Returns​

Promise<void>

Inherited from​

HotTester.onTestPagePathEnd

Defined in​

HotTester.ts:148


onTestPagePathStart​

â–¸ onTestPagePathStart(destination, page, stop, continueWhenTestIsComplete?): Promise<boolean>

Executed when page tests are started. If this returns false, the testPath will not be immediately executed afterwards.

Parameters​

NameTypeDefault value
destinationHotDestinationundefined
pageHotTestPageundefined
stopHotTestStopundefined
continueWhenTestIsCompletebooleanfalse

Returns​

Promise<boolean>

Overrides​

HotTester.onTestPagePathStart

Defined in​

HotTesterMocha.ts:82


onTestStart​

â–¸ onTestStart(destination, destinationKey?): Promise<boolean>

Executed when tests are started.

Parameters​

NameTypeDefault value
destinationHotDestinationundefined
destinationKeystring""

Returns​

Promise<boolean>

Overrides​

HotTester.onTestStart

Defined in​

HotTesterMocha.ts:65


setup​

â–¸ setup(): Promise<void>

Executed when setting up the tester.

Returns​

Promise<void>

Overrides​

HotTester.setup

Defined in​

HotTesterMocha.ts:51


waitForData​

â–¸ waitForData(): Promise<void>

Waits for the API to finish loading all data.

Returns​

Promise<void>

Inherited from​

HotTester.waitForData

Defined in​

HotTester.ts:172


interpretDestination​

â–¸ Static interpretDestination(mapName, testDest): HotDestination

Get a destination JSON object to use.

Parameters​

NameType
mapNamestring
testDestHotTestDestination

Returns​

HotDestination

Inherited from​

HotTester.interpretDestination

Defined in​

HotTester.ts:201