Skip to content

Commit

Permalink
Add the only property back to the exported test function
Browse files Browse the repository at this point in the history
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 */
})
```
  • Loading branch information
Raynos authored and James Halliday committed May 9, 2013
1 parent d729135 commit d22deba
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions index.js
Expand Up @@ -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) {
Expand Down

0 comments on commit d22deba

Please sign in to comment.