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

🐛 Bug: skip shows "pending" instead of "skipped" #5138

Open
4 tasks done
greggman opened this issue Apr 16, 2024 · 3 comments
Open
4 tasks done

🐛 Bug: skip shows "pending" instead of "skipped" #5138

greggman opened this issue Apr 16, 2024 · 3 comments
Labels
semver-patch implementation requires increase of "patch" version number; "bug fixes" status: accepting prs Mocha can use your help with this one! type: bug a defect, confirmed by a maintainer

Comments

@greggman
Copy link
Contributor

greggman commented Apr 16, 2024

Bug Report Checklist

  • I have read and agree to Mocha's Code of Conduct and Contributing Guidelines
  • I have searched for related issues and issues with the faq label, but none matched my issue.
  • I have 'smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, my usage of Mocha, or Mocha itself.
  • I want to provide a PR to resolve this

Expected

When a test is skipped via skip it shows "skipped" in the report including the reason passed to skip and you can click it and see the test.

Actual

It shows "pending" and there's nothing to click

Screen.Recording.2024-04-16.at.08.55.19.mov

Minimal, Reproducible Example

mocha.setup('bdd');

describe('test', () => {

  it('one', async function () {
    this.skip('reason1');
  });

  it('two', function (done) {
    this.skip('reason2');
  });

  it('three', function () {
    this.skip('reason3');
  });

  it('four', function () {
  });

});

mocha.run();

jsfiddle: https://jsfiddle.net/greggman/uyp5nvLo/

Versions

// [email protected] in javascript ES2018

Additional Info

I'm guessing this is considered "working as intended"? Every other test system I've used (which isn't many) tells you "skipped" when skipping a test. Pending = the test is still running with a very long timeout.

I spent an hour or more trying to figure out why skip wasn't working since it wasn't telling me 'skipped' but 'pending'. That's when I made the minimal repo and found 'pending' apparently means 'skipped' because if I don't call 'done' then I get a timeout

@greggman greggman added status: in triage a maintainer should (re-)triage (review) this issue type: bug a defect, confirmed by a maintainer labels Apr 16, 2024
@JoshuaKGoldberg JoshuaKGoldberg changed the title skip shows "pending" instead of "skipped" 🐛 Bug: skip shows "pending" instead of "skipped" Jul 3, 2024
@JoshuaKGoldberg
Copy link
Member

This seems like a straightforward bug to me, thanks for filing!

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Mocha can use your help with this one! semver-patch implementation requires increase of "patch" version number; "bug fixes" and removed status: in triage a maintainer should (re-)triage (review) this issue labels Jul 3, 2024
@mrazauskas
Copy link

@JoshuaKGoldberg To be honest, I am also annoyed to see skipped tests reported as pending. But..

Feels like this is how Mocha was designed. Hm.. But I think that the Pending Tests section speaks about the TODO tests. Those can be named pending or todo, that is fine. What I do not like is to call skipped tests as pending. That’s different case. Or?

There is also a --forbid-pending flag. I think it should be renamed to --forbid-skipped (the original could be left as an alias).

I just wanted to clarify how do you imagine the pending status to be redesigned. (In a way, this looks like a redesign.)

@JoshuaKGoldberg
Copy link
Member

I think for now, let's just fix the displayed text / UI that users see. Changing CLI flags or API properties would be a followup breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch implementation requires increase of "patch" version number; "bug fixes" status: accepting prs Mocha can use your help with this one! type: bug a defect, confirmed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants