mocha-2.5.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. // SSSSSSSSSSSSSSS TTTTTTTTTTTTTTTTTTTTTTT OOOOOOOOO PPPPPPPPPPPPPPPPP
  2. // SS:::::::::::::::ST:::::::::::::::::::::T OO:::::::::OO P::::::::::::::::P
  3. // S:::::SSSSSS::::::ST:::::::::::::::::::::T OO:::::::::::::OO P::::::PPPPPP:::::P
  4. // S:::::S SSSSSSST:::::TT:::::::TT:::::TO:::::::OOO:::::::OPP:::::P P:::::P
  5. // S:::::S TTTTTT T:::::T TTTTTTO::::::O O::::::O P::::P P:::::P
  6. // S:::::S T:::::T O:::::O O:::::O P::::P P:::::P
  7. // S::::SSSS P::::PPPPPP:::::P
  8. // SS::::::SSSSS This file is generated. To update it, P:::::::::::::PP
  9. // SSS::::::::SS run roll_closure_compiler. P::::PPPPPPPPP
  10. // SSSSSS::::S P::::P
  11. // S:::::S T:::::T O:::::O O:::::O P::::P
  12. // S:::::S T:::::T O::::::O O::::::O P::::P
  13. // SSSSSSS S:::::S TT:::::::TT O:::::::OOO:::::::OPP::::::PP
  14. // S::::::SSSSSS:::::S T:::::::::T OO:::::::::::::OO P::::::::P
  15. // S:::::::::::::::SS T:::::::::T OO:::::::::OO P::::::::P
  16. // SSSSSSSSSSSSSSS TTTTTTTTTTT OOOOOOOOO PPPPPPPPPP
  17. /*
  18. * Copyright 2016 The Closure Compiler Authors.
  19. *
  20. * Licensed under the Apache License, Version 2.0 (the "License");
  21. * you may not use this file except in compliance with the License.
  22. * You may obtain a copy of the License at
  23. *
  24. * http://www.apache.org/licenses/LICENSE-2.0
  25. *
  26. * Unless required by applicable law or agreed to in writing, software
  27. * distributed under the License is distributed on an "AS IS" BASIS,
  28. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  29. * See the License for the specific language governing permissions and
  30. * limitations under the License.
  31. */
  32. /**
  33. * @fileoverview Externs definitions for Mocha, 2.5 branch.
  34. *
  35. * This file currently only defines the TDD API, and that part should be
  36. * complete.
  37. *
  38. * @externs
  39. * @see https://mochajs.org/
  40. */
  41. /**
  42. * @typedef {function(function(*=): *): (*|IThenable<*>)}
  43. */
  44. var ActionFunction;
  45. // Below are the externs for the TDD API: https://mochajs.org/#tdd
  46. /**
  47. * @param {string} description
  48. * @param {function(): void} spec
  49. */
  50. var suite = function(description, spec) {};
  51. /**
  52. * @param {!ActionFunction} action
  53. */
  54. var setup = function(action) {};
  55. /**
  56. * @param {!ActionFunction} action
  57. */
  58. var teardown = function(action) {};
  59. /**
  60. * @param {!ActionFunction} action
  61. */
  62. var suiteSetup = function(action) {};
  63. /**
  64. * @param {!ActionFunction} action
  65. */
  66. var suiteTeardown = function(action) {};
  67. /**
  68. * @param {string} expectation
  69. * @param {!ActionFunction=} assertion
  70. */
  71. var test = function(expectation, assertion) {};
  72. // Below are the externs for the BDD API: https://mochajs.org/#bdd
  73. /**
  74. * @param {string} description
  75. * @param {function(): void} spec
  76. */
  77. var describe = function(description, spec) {};
  78. /**
  79. * @param {string} description
  80. * @param {function(): void} spec
  81. */
  82. var context = function(description, spec) {};
  83. /**
  84. * @param {string} expectation
  85. * @param {!ActionFunction=} assertion
  86. */
  87. var it = function(expectation, assertion) {};
  88. /**
  89. * @param {string} expectation
  90. * @param {!ActionFunction=} assertion
  91. */
  92. var specify = function(expectation, assertion) {};
  93. /**
  94. * @param {!ActionFunction} action
  95. */
  96. var before = function(action) {};
  97. /**
  98. * @param {!ActionFunction} action
  99. */
  100. var after = function(action) {};
  101. /**
  102. * @param {!ActionFunction} action
  103. */
  104. var beforeEach = function(action) {};
  105. /**
  106. * @param {!ActionFunction} action
  107. */
  108. var afterEach = function(action) {};