Skip to content

Commit

Permalink
add t.only()
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jun 25, 2017
1 parent 0f474d9 commit dc67c58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/base.js
Expand Up @@ -44,7 +44,7 @@ function Base (options) {
this.jobs = +ownOrEnv(options, 'jobs', 'TAP_JOBS') || 0
this.skip = ownOr(options, 'skip', false)
this.todo = ownOr(options, 'todo', false)
this.only = ownOr(options, 'only', false)
this.runOnly = ownOr(options, 'runOnly', false)
this.setupParser(options)
this.finished = false
this.output = ''
Expand Down
6 changes: 6 additions & 0 deletions lib/test.js
Expand Up @@ -160,6 +160,12 @@ Test.prototype.sub = function (Class, extra, caller) {
return d.promise
}

Test.prototype.only = function test (name, extra, cb) {
extra = parseTestArgs(name, extra, cb)
extra.only = true
return this.sub(Test, extra, test)
}

Test.prototype.test = function test (name, extra, cb) {
extra = parseTestArgs(name, extra, cb)
return this.sub(Test, extra, test)
Expand Down

0 comments on commit dc67c58

Please sign in to comment.