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

skip shows "pending" instead of "skipped" #5138

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

skip shows "pending" instead of "skipped" #5138

greggman opened this issue Apr 16, 2024 · 0 comments
Labels
status: in triage a maintainer should (re-)triage (review) this issue 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

// mocha@10.4.0 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in triage a maintainer should (re-)triage (review) this issue type: bug a defect, confirmed by a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant