From f016bdbc35b7efa44bd63413bde09433ea916c59 Mon Sep 17 00:00:00 2001 From: HumairAK Date: Tue, 26 Jul 2016 03:43:04 -0400 Subject: added some unit testing, need a lot more --- node_modules/mocha/lib/test.js | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 node_modules/mocha/lib/test.js (limited to 'node_modules/mocha/lib/test.js') diff --git a/node_modules/mocha/lib/test.js b/node_modules/mocha/lib/test.js new file mode 100644 index 0000000..a95cd31 --- /dev/null +++ b/node_modules/mocha/lib/test.js @@ -0,0 +1,44 @@ +/** + * Module dependencies. + */ + +var Runnable = require('./runnable'); +var inherits = require('./utils').inherits; + +/** + * Expose `Test`. + */ + +module.exports = Test; + +/** + * Initialize a new `Test` with the given `title` and callback `fn`. + * + * @api private + * @param {String} title + * @param {Function} fn + */ +function Test(title, fn) { + Runnable.call(this, title, fn); + this.pending = !fn; + this.type = 'test'; +} + +/** + * Inherit from `Runnable.prototype`. + */ +inherits(Test, Runnable); + +Test.prototype.clone = function() { + var test = new Test(this.title, this.fn); + test.timeout(this.timeout()); + test.slow(this.slow()); + test.enableTimeouts(this.enableTimeouts()); + test.retries(this.retries()); + test.currentRetry(this.currentRetry()); + test.globals(this.globals()); + test.parent = this.parent; + test.file = this.file; + test.ctx = this.ctx; + return test; +}; -- cgit v1.2.3