Closed thekevinscott closed 9 years ago
Hi, sorry to use the issues here to ask a question
Don't be - usability issues are important.
Loading tests is not the responsibility of the reporter. You can have this boot-straping logic as the one "test" that is passed into mocha-casperjs
, and then choose any reporter you wish.
As for the logic, I think it can work. If a straight up require
doesn't register the tests under the describe
block as you think, you can expose the tests via an object and have this boot-strapper register it. it won't look as pretty that way, and then nesting inside that wouldn't work.... hopefully it works as you coded it.
That's a good idea I hadn't considered, thanks Nathan. I'll give that a shot.
Hi, sorry to use the issues here to ask a question but I'm a bit stumped and hoping someone might be able to help.
I'm trying to write a third party reporter for Mocha. Our tests are organized in folders like:
Which we specify as a file array in a grunt script.
What I'm hoping to see in the output is something like:
Where create has a single describe block, "Create", and a single test, "should foo".
I can achieve what I'm asking for by modifying cli.js like so:
Obviously this wouldn't work for tests nested multiple levels deep, but this basically does what I'm looking to achieve.
Because tests are required in the cli.js script the suites in the reporter have no access to their parent file. Is there any way to achieve what I'm asking that wouldn't require modifying cli.js? I'm kinda stumped.