Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unreachable Results.prototype.only code #217

Merged
merged 1 commit into from
Dec 26, 2015

Conversation

taylorhakes
Copy link
Contributor

I was looking though the results.js file and noticed invalid code.

if (this._only) {
  self.count ++;
  self.fail ++;
  write('not ok ' + self.count + ' already called .only()\n');
}

self and write are not defined. I tried to write a failing test, but found out that the code was unreachable because there is a similar check in index.js before reaching this code.

if (only) throw new Error('there can only be one only test');
results.only(name);

This pull requests removes the broken unreachable code. I also added a test for duplicate test.only calls.

@Raynos
Copy link
Collaborator

Raynos commented Dec 26, 2015

Thanks for this bugfix :)

Raynos added a commit that referenced this pull request Dec 26, 2015
Removed unreachable Results.prototype.only code
@Raynos Raynos merged commit 87e4bec into tape-testing:master Dec 26, 2015
@Raynos
Copy link
Collaborator

Raynos commented Dec 26, 2015

Published v4.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants