api documentation for mocha (v3.3.0)

simple, flexible, fun test framework

table of contents

  1. module mocha
    1. function mocha.base (runner)
    2. function mocha.context ()
    3. function mocha.dot (runner)
    4. function mocha.hook (title, fn)
    5. function mocha.html (runner)
    6. function mocha.landing (runner)
    7. function mocha.list (runner)
    8. function mocha.nyan (runner)
    9. function mocha.progress ()
    10. function mocha.runnable (title, fn)
    11. function mocha.runner (suite, delay)
    12. function mocha.suite (title, parentContext)
    13. function mocha.xunit (runner, options)
    14. object mocha.base.prototype
    15. object mocha.context.prototype
    16. object mocha.events
    17. object mocha.hook.prototype
    18. object mocha.html.prototype
    19. object mocha.index
    20. object mocha.nyan.prototype
    21. object mocha.progress.prototype
    22. object mocha.runnable.prototype
    23. object mocha.runner.prototype
    24. object mocha.suite.prototype
    25. object mocha.tty
    26. object mocha.utils
    27. object mocha.xunit.prototype
  2. module mocha.base
    1. boolean mocha.base.inlineDiffs
    2. function mocha.base (runner)
    3. function mocha.base.color (type, str)
    4. function mocha.base.list (failures)
    5. object mocha.base.colors
    6. object mocha.base.cursor
    7. object mocha.base.symbols
    8. object mocha.base.useColors
    9. object mocha.base.window
  3. module mocha.base.prototype
    1. function mocha.base.prototype.epilogue ()
  4. module mocha.context
    1. function mocha.context ()
  5. module mocha.context.prototype
    1. function mocha.context.prototype.enableTimeouts (enabled)
    2. function mocha.context.prototype.inspect ()
    3. function mocha.context.prototype.retries (n)
    4. function mocha.context.prototype.runnable (runnable)
    5. function mocha.context.prototype.skip ()
    6. function mocha.context.prototype.slow (ms)
    7. function mocha.context.prototype.timeout (ms)
  6. module mocha.dot
    1. function mocha.dot (runner)
    2. function mocha.dot.super_ (runner)
  7. module mocha.events
    1. function mocha.events.EventEmitter ()
  8. module mocha.hook
    1. function mocha.hook (title, fn)
    2. function mocha.hook.super_ (title, fn)
  9. module mocha.hook.prototype
    1. function mocha.hook.prototype.error (err)
  10. module mocha.html
    1. function mocha.html (runner)
  11. module mocha.html.prototype
    1. function mocha.html.prototype.addCodeToggle (el, contents)
    2. function mocha.html.prototype.suiteURL (suite)
    3. function mocha.html.prototype.testURL (test)
  12. module mocha.index
    1. function mocha.index.bdd (suite)
    2. function mocha.index.exports (suite)
    3. function mocha.index.qunit (suite)
    4. function mocha.index.tdd (suite)
  13. module mocha.landing
    1. function mocha.landing (runner)
    2. function mocha.landing.super_ (runner)
  14. module mocha.list
    1. function mocha.list (runner)
    2. function mocha.list.super_ (runner)
  15. module mocha.nyan
    1. function mocha.nyan (runner)
    2. function mocha.nyan.super_ (runner)
  16. module mocha.nyan.prototype
    1. function mocha.nyan.prototype.appendRainbow ()
    2. function mocha.nyan.prototype.cursorDown (n)
    3. function mocha.nyan.prototype.cursorUp (n)
    4. function mocha.nyan.prototype.draw ()
    5. function mocha.nyan.prototype.drawNyanCat ()
    6. function mocha.nyan.prototype.drawRainbow ()
    7. function mocha.nyan.prototype.drawScoreboard ()
    8. function mocha.nyan.prototype.face ()
    9. function mocha.nyan.prototype.generateColors ()
    10. function mocha.nyan.prototype.rainbowify (str)
  17. module mocha.progress
    1. function mocha.progress ()
  18. module mocha.progress.prototype
    1. function mocha.progress.prototype.draw (ctx)
    2. function mocha.progress.prototype.font (family)
    3. function mocha.progress.prototype.fontSize (size)
    4. function mocha.progress.prototype.size (size)
    5. function mocha.progress.prototype.text (text)
    6. function mocha.progress.prototype.update (n)
  19. module mocha.runnable
    1. function mocha.runnable (title, fn)
  20. module mocha.runnable.prototype
    1. function mocha.runnable.prototype.clearTimeout ()
    2. function mocha.runnable.prototype.constructor (title, fn)
    3. function mocha.runnable.prototype.currentRetry (n)
    4. function mocha.runnable.prototype.enableTimeouts (enabled)
    5. function mocha.runnable.prototype.fullTitle ()
    6. function mocha.runnable.prototype.globals (globals)
    7. function mocha.runnable.prototype.inspect ()
    8. function mocha.runnable.prototype.isPending ()
    9. function mocha.runnable.prototype.resetTimeout ()
    10. function mocha.runnable.prototype.retries (n)
    11. function mocha.runnable.prototype.run (fn)
    12. function mocha.runnable.prototype.skip ()
    13. function mocha.runnable.prototype.slow (ms)
    14. function mocha.runnable.prototype.timeout (ms)
  21. module mocha.runner
    1. function mocha.runner (suite, delay)
    2. function mocha.runner.immediately ()
    3. function mocha.runner.super_ ()
  22. module mocha.runner.prototype
    1. function mocha.runner.prototype.abort ()
    2. function mocha.runner.prototype.checkGlobals (test)
    3. function mocha.runner.prototype.fail (test, err)
    4. function mocha.runner.prototype.failHook (hook, err)
    5. function mocha.runner.prototype.globalProps ()
    6. function mocha.runner.prototype.globals (arr)
    7. function mocha.runner.prototype.grep (re, invert)
    8. function mocha.runner.prototype.grepTotal (suite)
    9. function mocha.runner.prototype.hook (name, fn)
    10. function mocha.runner.prototype.hookDown (name, fn)
    11. function mocha.runner.prototype.hookUp (name, fn)
    12. function mocha.runner.prototype.hooks (name, suites, fn)
    13. function mocha.runner.prototype.parents ()
    14. function mocha.runner.prototype.run (fn)
    15. function mocha.runner.prototype.runSuite (suite, fn)
    16. function mocha.runner.prototype.runTest (fn)
    17. function mocha.runner.prototype.runTests (suite, fn)
    18. function mocha.runner.prototype.uncaught (err)
  23. module mocha.suite
    1. function mocha.suite (title, parentContext)
    2. function mocha.suite.create (parent, title)
    3. function mocha.suite.super_ ()
  24. module mocha.suite.prototype
    1. function mocha.suite.prototype.addSuite (suite)
    2. function mocha.suite.prototype.addTest (test)
    3. function mocha.suite.prototype.afterAll (title, fn)
    4. function mocha.suite.prototype.afterEach (title, fn)
    5. function mocha.suite.prototype.bail (bail)
    6. function mocha.suite.prototype.beforeAll (title, fn)
    7. function mocha.suite.prototype.beforeEach (title, fn)
    8. function mocha.suite.prototype.clone ()
    9. function mocha.suite.prototype.eachTest (fn)
    10. function mocha.suite.prototype.enableTimeouts (enabled)
    11. function mocha.suite.prototype.fullTitle ()
    12. function mocha.suite.prototype.isPending ()
    13. function mocha.suite.prototype.retries (n)
    14. function mocha.suite.prototype.run ()
    15. function mocha.suite.prototype.slow (ms)
    16. function mocha.suite.prototype.timeout (ms)
    17. function mocha.suite.prototype.total ()
  25. module mocha.tty
    1. function mocha.tty.getWindowSize ()
    2. function mocha.tty.isatty ()
  26. module mocha.utils
    1. function mocha.utils.canonicalize (value, stack, typeHint)
    2. function mocha.utils.clean (str)
    3. function mocha.utils.escape (html)
    4. function mocha.utils.files (dir, ext, ret)
    5. function mocha.utils.filter (arr, fn)
    6. function mocha.utils.forEach (arr, fn, scope)
    7. function mocha.utils.getError (err)
    8. function mocha.utils.highlightTags (name)
    9. function mocha.utils.indexOf (arr, obj, start)
    10. function mocha.utils.inherits (ctor, superCtor)
    11. function mocha.utils.isArray ()
    12. function mocha.utils.isBuffer (value)
    13. function mocha.utils.isPromise (value)
    14. function mocha.utils.isString (obj)
    15. function mocha.utils.keys ()
    16. function mocha.utils.lookupFiles (path, extensions, recursive)
    17. function mocha.utils.map (arr, fn, scope)
    18. function mocha.utils.noop ()
    19. function mocha.utils.parseQuery (qs)
    20. function mocha.utils.reduce (arr, fn, val)
    21. function mocha.utils.slug (str)
    22. function mocha.utils.some (arr, fn)
    23. function mocha.utils.stackTraceFilter ()
    24. function mocha.utils.stringify (value)
    25. function mocha.utils.trim (str)
    26. function mocha.utils.type (value)
    27. function mocha.utils.undefinedError ()
    28. function mocha.utils.watch (files, fn)
  27. module mocha.xunit
    1. function mocha.xunit (runner, options)
    2. function mocha.xunit.super_ (runner)
  28. module mocha.xunit.prototype
    1. function mocha.xunit.prototype.done (failures, fn)
    2. function mocha.xunit.prototype.test (test)
    3. function mocha.xunit.prototype.write (line)

module mocha

function mocha.base (runner)

function mocha.context ()

function mocha.dot (runner)

function mocha.hook (title, fn)

function mocha.html (runner)

function mocha.landing (runner)

function mocha.list (runner)

function mocha.nyan (runner)

function mocha.progress ()

function mocha.runnable (title, fn)

function mocha.runner (suite, delay)

function mocha.suite (title, parentContext)

function mocha.xunit (runner, options)

module mocha.base

function mocha.base (runner)

function mocha.base.color (type, str)

function mocha.base.list (failures)

module mocha.base.prototype

function mocha.base.prototype.epilogue ()

module mocha.context

function mocha.context ()

module mocha.context.prototype

function mocha.context.prototype.enableTimeouts (enabled)

function mocha.context.prototype.inspect ()

function mocha.context.prototype.retries (n)

function mocha.context.prototype.runnable (runnable)

function mocha.context.prototype.skip ()

function mocha.context.prototype.slow (ms)

function mocha.context.prototype.timeout (ms)

module mocha.dot

function mocha.dot (runner)

function mocha.dot.super_ (runner)

module mocha.events

function mocha.events.EventEmitter ()

module mocha.hook

function mocha.hook (title, fn)

function mocha.hook.super_ (title, fn)

module mocha.hook.prototype

function mocha.hook.prototype.error (err)

module mocha.html

function mocha.html (runner)

module mocha.html.prototype

function mocha.html.prototype.addCodeToggle (el, contents)

function mocha.html.prototype.suiteURL (suite)

function mocha.html.prototype.testURL (test)

module mocha.index

function mocha.index.bdd (suite)

function mocha.index.exports (suite)

function mocha.index.qunit (suite)

function mocha.index.tdd (suite)

module mocha.landing

function mocha.landing (runner)

function mocha.landing.super_ (runner)

module mocha.list

function mocha.list (runner)

function mocha.list.super_ (runner)

module mocha.nyan

function mocha.nyan (runner)

function mocha.nyan.super_ (runner)

module mocha.nyan.prototype

function mocha.nyan.prototype.appendRainbow ()

function mocha.nyan.prototype.cursorDown (n)

function mocha.nyan.prototype.cursorUp (n)

function mocha.nyan.prototype.draw ()

function mocha.nyan.prototype.drawNyanCat ()

function mocha.nyan.prototype.drawRainbow ()

function mocha.nyan.prototype.drawScoreboard ()

function mocha.nyan.prototype.face ()

function mocha.nyan.prototype.generateColors ()

function mocha.nyan.prototype.rainbowify (str)

module mocha.progress

function mocha.progress ()

module mocha.progress.prototype

function mocha.progress.prototype.draw (ctx)

function mocha.progress.prototype.font (family)

function mocha.progress.prototype.fontSize (size)

function mocha.progress.prototype.size (size)

function mocha.progress.prototype.text (text)

function mocha.progress.prototype.update (n)

module mocha.runnable

function mocha.runnable (title, fn)

module mocha.runnable.prototype

function mocha.runnable.prototype.clearTimeout ()

function mocha.runnable.prototype.constructor (title, fn)

function mocha.runnable.prototype.currentRetry (n)

function mocha.runnable.prototype.enableTimeouts (enabled)

function mocha.runnable.prototype.fullTitle ()

function mocha.runnable.prototype.globals (globals)

function mocha.runnable.prototype.inspect ()

function mocha.runnable.prototype.isPending ()

function mocha.runnable.prototype.resetTimeout ()

function mocha.runnable.prototype.retries (n)

function mocha.runnable.prototype.run (fn)

function mocha.runnable.prototype.skip ()

function mocha.runnable.prototype.slow (ms)

function mocha.runnable.prototype.timeout (ms)

module mocha.runner

function mocha.runner (suite, delay)

function mocha.runner.immediately ()

function mocha.runner.super_ ()

module mocha.runner.prototype

function mocha.runner.prototype.abort ()

function mocha.runner.prototype.checkGlobals (test)

function mocha.runner.prototype.fail (test, err)

function mocha.runner.prototype.failHook (hook, err)

function mocha.runner.prototype.globalProps ()

function mocha.runner.prototype.globals (arr)

function mocha.runner.prototype.grep (re, invert)

function mocha.runner.prototype.grepTotal (suite)

function mocha.runner.prototype.hook (name, fn)

function mocha.runner.prototype.hookDown (name, fn)

function mocha.runner.prototype.hookUp (name, fn)

function mocha.runner.prototype.hooks (name, suites, fn)

function mocha.runner.prototype.parents ()

function mocha.runner.prototype.run (fn)

function mocha.runner.prototype.runSuite (suite, fn)

function mocha.runner.prototype.runTest (fn)

function mocha.runner.prototype.runTests (suite, fn)

function mocha.runner.prototype.uncaught (err)

module mocha.suite

function mocha.suite (title, parentContext)

function mocha.suite.create (parent, title)

function mocha.suite.super_ ()

module mocha.suite.prototype

function mocha.suite.prototype.addSuite (suite)

function mocha.suite.prototype.addTest (test)

function mocha.suite.prototype.afterAll (title, fn)

function mocha.suite.prototype.afterEach (title, fn)

function mocha.suite.prototype.bail (bail)

function mocha.suite.prototype.beforeAll (title, fn)

function mocha.suite.prototype.beforeEach (title, fn)

function mocha.suite.prototype.clone ()

function mocha.suite.prototype.eachTest (fn)

function mocha.suite.prototype.enableTimeouts (enabled)

function mocha.suite.prototype.fullTitle ()

function mocha.suite.prototype.isPending ()

function mocha.suite.prototype.retries (n)

function mocha.suite.prototype.run ()

function mocha.suite.prototype.slow (ms)

function mocha.suite.prototype.timeout (ms)

function mocha.suite.prototype.total ()

module mocha.tty

function mocha.tty.getWindowSize ()

function mocha.tty.isatty ()

module mocha.utils

function mocha.utils.canonicalize (value, stack, typeHint)

function mocha.utils.clean (str)

function mocha.utils.escape (html)

function mocha.utils.files (dir, ext, ret)

function mocha.utils.filter (arr, fn)

function mocha.utils.forEach (arr, fn, scope)

function mocha.utils.getError (err)

function mocha.utils.highlightTags (name)

function mocha.utils.indexOf (arr, obj, start)

function mocha.utils.inherits (ctor, superCtor)

function mocha.utils.isArray ()

function mocha.utils.isBuffer (value)

function mocha.utils.isPromise (value)

function mocha.utils.isString (obj)

function mocha.utils.keys ()

function mocha.utils.lookupFiles (path, extensions, recursive)

function mocha.utils.map (arr, fn, scope)

function mocha.utils.noop ()

function mocha.utils.parseQuery (qs)

function mocha.utils.reduce (arr, fn, val)

function mocha.utils.slug (str)

function mocha.utils.some (arr, fn)

function mocha.utils.stackTraceFilter ()

function mocha.utils.stringify (value)

function mocha.utils.trim (str)

function mocha.utils.type (value)

function mocha.utils.undefinedError ()

function mocha.utils.watch (files, fn)

module mocha.xunit

function mocha.xunit (runner, options)

function mocha.xunit.super_ (runner)

module mocha.xunit.prototype

function mocha.xunit.prototype.done (failures, fn)

function mocha.xunit.prototype.test (test)

function mocha.xunit.prototype.write (line)

[ this document was created with utility2 ]