API Docs for: 0.9.3
Show:

File: lib/clientDecorator/plain.js

  1. // Copyright 2014, Yahoo! Inc.
  2. // Copyrights licensed under the Mit License. See the accompanying LICENSE file for terms.
  3.  
  4. var AbstractClientDecorator = require('../abstractClientDecorator');
  5. var Promise = require('promise');
  6.  
  7. /**
  8. * @class PlainClientDecorator
  9. * @extends AbstractClientDecorator
  10. * @constructor
  11. */
  12. var PlainClientDecorator = AbstractClientDecorator.extend(
  13.  
  14. {
  15. /**
  16. * Called when reporting starts
  17. *
  18. * @method start
  19. */
  20. start: function () {
  21. console.log('PLAIN: start');
  22. },
  23.  
  24. /**
  25. * Called when reporting stops
  26. *
  27. * @method stop
  28. */
  29. stop: function () {
  30. console.log('PLAIN: stop');
  31. },
  32.  
  33.  
  34. /**
  35. * Reporting is completed
  36. *
  37. * @method complete
  38. */
  39. complete: function () {
  40. console.log('PLAIN: complete');
  41. },
  42.  
  43.  
  44. /**
  45. * Called when any item has custom data
  46. *
  47. * @method itemData
  48. * @param {string} id
  49. * @param {string} json JSON-data
  50. */
  51. itemData: function (id, json) {
  52. console.log('PLAIN: itemData', id, json);
  53. },
  54.  
  55. /**
  56. * Called when any item has a custom message
  57. *
  58. * @method itemMessage
  59. * @param {string} id
  60. * @param {string} message
  61. */
  62. itemMessage: function (id, message) {
  63. console.log('PLAIN: itemMessage', id, message);
  64. },
  65.  
  66.  
  67. /**
  68. * Called when suite starts
  69. *
  70. * @method suiteStart
  71. * @param {string} id
  72. * @param {string} parentId
  73. * @param {string} suiteName
  74. */
  75. suiteStart: function (id, parentId, suiteName) {
  76. console.log('PLAIN: suiteStart', id, parentId, suiteName);
  77. },
  78.  
  79. /**
  80. * Called when suite ends
  81. *
  82. * @method suiteEnd
  83. * @param {string} id
  84. */
  85. suiteEnd: function (id) {
  86. console.log('PLAIN: suiteEnd', id);
  87. },
  88.  
  89.  
  90. /**
  91. * Called when test starts
  92. *
  93. * @method testStart
  94. * @param {string} id
  95. * @param {string} parentId
  96. * @param {string} testName
  97. */
  98. testStart: function (id, parentId, testName) {
  99. console.log('PLAIN: testStart', id, parentId, testName);
  100. },
  101.  
  102.  
  103. /**
  104. * Called when test fails
  105. *
  106. * @method testFailed
  107. * @param {string} id
  108. * @param {string} [message]
  109. * @param {string} [reason]
  110. */
  111. testFailed: function (id, message, reason) {
  112. console.log('PLAIN: testFailed', id, message, reason);
  113. },
  114.  
  115. /**
  116. * Called when test has an error
  117. *
  118. * @method testError
  119. * @param {string} id
  120. * @param {string} [message]
  121. * @param {string} [reason]
  122. */
  123. testError: function (id, message, reason) {
  124. console.log('PLAIN: testError', id, message, reason);
  125. },
  126.  
  127. /**
  128. * Called when test has passed
  129. *
  130. * @method testPassed
  131. * @param {string} id
  132. */
  133. testPassed: function (id) {
  134. console.log('PLAIN: testPassed', id);
  135. },
  136.  
  137. /**
  138. * Called when test is undefined
  139. *
  140. * @method testUndefined
  141. * @param {string} id
  142. */
  143. testUndefined: function (id) {
  144. console.log('PLAIN: testUndefined', id);
  145. },
  146.  
  147. /**
  148. * Called when test is skipped
  149. *
  150. * @method testSkipped
  151. * @param {string} id
  152. * @param {string} [reason]
  153. */
  154. testSkipped: function (id, reason) {
  155. console.log('PLAIN: testSkipped', id, reason);
  156. },
  157.  
  158. /**
  159. * Called when test is incomplete
  160. *
  161. * @method testIncomplete
  162. * @param {string} id
  163. */
  164. testIncomplete: function (id) {
  165. console.log('PLAIN: testIncomplete', id);
  166. },
  167.  
  168.  
  169. /**
  170. * Processes the begin of the testing environment
  171. *
  172. * @method processBefore
  173. * @return {Promise}
  174. */
  175. processBefore: function () {
  176. console.log('PLAIN: processBefore');
  177. return Promise.resolve();
  178. },
  179.  
  180. /**
  181. * Processes the end of the testing environment
  182. *
  183. * @method processAfter
  184. * @return {Promise}
  185. */
  186. processAfter: function () {
  187. console.log('PLAIN: processAfter');
  188. return Promise.resolve();
  189. },
  190.  
  191. /**
  192. * Processes the beginning of a test
  193. *
  194. * @method processBeforeTest
  195. * @return {Promise}
  196. */
  197. processBeforeTest: function () {
  198. console.log('PLAIN: processBeforeTest');
  199. return Promise.resolve();
  200. },
  201.  
  202. /**
  203. * Processes the ending of a test
  204. *
  205. * @method processAfterTest
  206. * @return {Promise}
  207. */
  208. processAfterTest: function () {
  209. console.log('PLAIN: processAfterTest');
  210. return Promise.resolve();
  211. }
  212. });
  213.  
  214. module.exports = PlainClientDecorator;
  215.