Skip to content

output API

titulus edited this page Sep 12, 2013 · 5 revisions

Contents

For the developers

test.it framework use strategy pattern for separating output modules from core. They are called printers. You need to know it's simple API to write your own printer (e.g. into the page DOM).

To tell the truth, for that moment (v1.2.1), there is only one public method .print() used by core. But you must implement all of them, for reason of providing future releases.

API

  • .print( value ) - checks .type of value, and if it:
    • 'test' - delegate call to the .test()
    • 'group' - delegate call to the .group()
    • 'error' - delegate call to the .error()
    • otherwise - outputs value in standart mode (e.g. console.log(value), document.write(value) etc.)
  • .test( test ) - outputs test
  • .group( group ) - outputs group
  • .error( error ) - outputs error

List

  • test.it-firebug - outputs via Web Console API. Example in Google Chrome chrome
  • test.it-nodej - outputs via console in node.js Example in WindowsXP shell winxp

Clone this wiki locally