From d22deba6da4da8b94e7a3a352eb029afecdaaadf Mon Sep 17 00:00:00 2001 From: Raynos Date: Wed, 8 May 2013 18:01:55 -0700 Subject: [PATCH] Add the only property back to the exported test function Your lazy loading of the module.exports broke back compat with the only property on the test object. This brings the only method back so people can do ```js var test = require("tape") test.only("run this test", function (assert) { /* my test */ }) ``` --- index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 6ddaab19..18d132ab 100644 --- a/index.js +++ b/index.js @@ -16,10 +16,16 @@ var nextTick = typeof setImmediate !== 'undefined' exports = module.exports = (function () { var harness; - return function () { - if (!harness) harness = createExitHarness(); + var lazyLoad = function () { + if (!harness) { + harness = createExitHarness(); + lazyLoad.only = harness.only; + } + return harness.apply(this, arguments); }; + + return lazyLoad })(); function createExitHarness (conf) {