API Docs for:
Show:

Bromine.Test Class

Defined in: src/Bromine.js:20
Module: Bromine

A Test Instance

Constructor

Bromine.Test

(
  • options
)

Defined in src/Bromine.js:20

Parameters:

  • options Object
    • [init] Function optional

      a function to execute before test start

    • [destroy] Function optional

      a function to execute after the test ends (should be used for cleanup)

    • [tests] Array optional

      a queue of functions to run

    • [depend] String optional

      a test dependancy

    • [fail_timeout=10s] Integer optional

      how much time to wait for tests to finish before reporting failure

Methods

next

()

Defined in src/Bromine.js:169

calls the next function in the stack

(
  • message
)

Defined in src/Bromine.js:131

signifies a test failure. Will stop any more steps from running

Parameters:

next

()

Defined in bin/bromine.js:726

calls the next function in the stack

current

()

Defined in bin/bromine.js:740

calls the current function in the stack

prev

()

Defined in bin/bromine.js:751

calls the previous function in the stack

log

(
  • params
)

Defined in src/Bromine.js:101

logs a result to the test

Parameters:

done

(
  • state
  • [message]
)

Defined in src/Bromine.js:110

Called when tests are done

Parameters:

  • state Bool

    whether test passed or failed

  • [message] String optional

    only used on failure

log

(
  • params
)

Defined in bin/bromine.js:658

logs a result to the test

Parameters:

done

(
  • state
  • [message]
)

Defined in bin/bromine.js:667

Called when tests are done

Parameters:

  • state Bool

    whether test passed or failed

  • [message] String optional

    only used on failure

current

()

Defined in src/Bromine.js:183

calls the current function in the stack

prev

()

Defined in src/Bromine.js:194

calls the previous function in the stack

addEvent

(
  • the
  • a
)
chainable

Inherited from Events but overwritten in bin/bromine.js:290

Adds an event

Parameters:

addEvents

(
  • literal
)
chainable

Inherited from Events but overwritten in bin/bromine.js:320

Helper to add multiple events at once

Parameters:

  • literal Object

    object of event types => callbacks

fireEvent

(
  • event
  • arguments
)
chainable

Inherited from Events but overwritten in bin/bromine.js:339

dispatches an event

Parameters:

  • event String

    type

  • arguments Mixed

    to pass with the event

removeEvent

(
  • event
  • function
)
chainable

Inherited from Events but overwritten in bin/bromine.js:378

removes a function from an event

Parameters:

addEventOnce

(
  • the
  • a
)
chainable

Inherited from Events but overwritten in bin/bromine.js:401

Adds an event for one execution, then removes it

Parameters:

fireLatchedEvent

(
  • the
  • arguments
)
chainable

Inherited from Events but overwritten in bin/bromine.js:423

Fires a latched event

Parameters:

  • the String

    event type

  • arguments Mixed

    to pass with the event

(
  • message
)

Defined in bin/bromine.js:688

signifies a test failure. Will stop any more steps from running

Parameters:

run

()

Defined in bin/bromine.js:648

runs the tests

run

()

Defined in src/Bromine.js:91

runs the tests

setOptions

(
  • options
)
chainable

Inherited from Options but overwritten in bin/bromine.js:506

Parameters:

Properties

results

Array

Defined in bin/bromine.js:600

holds a stack of reported results

results

Array

Defined in src/Bromine.js:43

holds a stack of reported results

Events

destory

Defined in bin/bromine.js:633

fires on object destruction

destory

Defined in src/Bromine.js:76

fires on object destruction

done

Defined in bin/bromine.js:621

fires if and when the test has finished running successfuly

Event Payload:

done

Defined in src/Bromine.js:64

fires if and when the test has finished running successfuly

Event Payload:

fail

Defined in bin/bromine.js:627

fires if and when the test has finished running but failed

Event Payload:

fail

Defined in src/Bromine.js:70

fires if and when the test has finished running but failed

Event Payload:

start

Defined in bin/bromine.js:617

fires when test starts running. Latched

start

Defined in src/Bromine.js:60

fires when test starts running. Latched