API Docs for: 0.0.4
Show:

Dalek.Test Class

Defined in: index.js:65
Module: DalekJS

Generates an test instance

Methods

_emitAssertionStatus

() private chainable

Defined in index.js:257

Emits an event that describes the current state of all assertions

_emitConcreteTestFinished

() private chainable

Defined in index.js:244

Emits an event, that the current test run has been finished

_emitTestFinished

() private chainable

Defined in index.js:287

Emits an event that describes the current state of all assertions. The event should be fired when a test is finished

_inheritAssertions

(
  • test
  • opts
)
private chainable

Defined in index.js:373

Set up the instance

Parameters:

  • test Test

    Instacne of test

  • opts Object

    Options

_inheritAssertions

(
  • test
)
private chainable

Defined in index.js:349

Copies assertion helper methods

Parameters:

  • test Test

    Instacne of test

_inheritAssertions

(
  • test
)
private chainable

Defined in index.js:333

Copies assertion methods

Parameters:

  • test Test

    Instacne of test

_onDriverMessage

(
  • data
)
private chainable

Defined in index.js:221

Checks if the test run is complete & emits/resolves all the needed events/promises when the run is complete

Parameters:

  • data Object

    Data that is returned by the driver:message event

_reportTestStarted

(
  • name
)
private chainable

Defined in index.js:207

Emits the test started event

Parameters:

  • name String

    Name of the test

_testFin

() Object private

Defined in index.js:310

Kicks off the test & binds all promises/events

Returns:

Object:

promise A promise

_testFinished

(
  • result
)
Object private

Defined in index.js:176

Emits the test finished events & resolves all promises when its done

Parameters:

  • result Object

    Promised result var

Returns:

Object:

result Promised result var

_testStatus

() Bool private chainable

Defined in index.js:274

Get the overall test status (assertions & expectation)

Returns:

Bool:

status The test status

checkAssertions

() Bool

Defined in index.js:146

Checks if all runned assertions passed

Returns:

Bool:

assertiosnFailed Any expectation failed

checkExpectations

() Bool

Defined in index.js:134

Checks if the runned tests fullfill the set expectations or if no expectations were raised

Returns:

Bool:

checkedExpectations Expectations match

done

() Object private

Defined in index.js:157

Sets up all the bindings needed for a test to run

Returns:

Object:

result A promise

expect

(
  • key
  • value
)
Mixed chainable

Defined in index.js:91

Global data store (works between the node & browser envs)

Parameters:

  • key String | Number

    Key to store or fetch data

  • value Mixed

    optional Data that should be stored

Returns:

Mixed:

Data that has been stored

expect

(
  • expecatation
)
chainable

Defined in index.js:77

Specify how many assertions are expected to run within a test. Very useful for ensuring that all your callbacks and assertions are run.

Parameters:

  • expecatation Integer

    Number of assertions that should be run

incrementExpectations

() chainable

Defined in index.js:110

Increment the number of executed assertions

incrementFailedAssertions

() chainable

Defined in index.js:122

Increment the number of failed assertions