mocha icon indicating copy to clipboard operation
mocha copied to clipboard

feat(suite): allow calling hook methods

Open perrin4869 opened this issue 1 year ago • 1 comments

PR Checklist

Overview

Closes https://github.com/mochajs/mocha/issues/5202 It seems the only reason this wasn't supported was simply the return value of calling beforeAll, etc, was not the hook itself, unlike the result of calling a function like describe, which does use the suite as the return value. I will look into adding tests and maybe some docs

perrin4869 avatar Oct 14 '24 03:10 perrin4869

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: perrin4869 / name: Julian Grinblat (e599ff107a2a0b7bea8f501382144a54f51df91a, 2b4b3c1869731cc7447449cca1c4b062e9c9a564, a78374d8fdabda9901a9c55b6c851351d94fa85a, aae63ffbf19adc6a390008b005a1e8a16888c133, 060c86da01a5fda292e1bbc8c10e7fccd6cfacf2, 7948b1dc863d54999d7720d9ee9eb2b221ff5273)

  • [x] Addresses an existing open issue: fixes #000 ... Closes #5202

By the way, a tip: the template has a place to put the Closes #5202. 🙂

I edited it in just now.

JoshuaKGoldberg avatar Oct 30 '24 15:10 JoshuaKGoldberg

oh oops, sorry about that 😅 thanks for editing! hm... maybe the failure is a flakey test here?

perrin4869 avatar Oct 30 '24 15:10 perrin4869

Looks like it! I re-ran the CI job and it's all passing. Phew 😄

JoshuaKGoldberg avatar Oct 30 '24 15:10 JoshuaKGoldberg

was getting worried there for a sec!

perrin4869 avatar Oct 30 '24 16:10 perrin4869