Closed sygint closed 7 years ago
I got it working, very hacky, needs a rewrite:
function describeItNested(mochaInstance, command, message, callback, options) {
if (command === 'it') {
mochaInstance.it(message, callback);
} else {
mochaInstance.describe(command, nestedFunc(mochaInstance, command, message, callback));
}
}
describeItNested.only = function (mochaInstance, command, message, callback, options) {
// only relies on grep against test labels,
// using non-breaking space as describe label to enable `only`
mochaInstance.describe.only(' ', nestedFunc(mochaInstance, command, message, callback));
};
describeItNested.skip = function (mochaInstance, command, message, callback, options) {
mochaInstance.describe.skip('', nestedFunc(mochaInstance, command, message, callback));
};
function nestedFunc(mochaInstance, command, message, callback) {
return function () {
mochaInstance.describe('', function () {
mochaInstance.describe(message, callback);
});
};
}
Hi @gnarmedia, thanks a lot for your input.
I agree that the output could use a cleanup, so I did that here, borrowing a bit from your snippet there: https://github.com/iensu/mocha-cakes-2/commit/060670565b5a825419119ff6c87530f964c53543
Alright to close this issue?
Best regards,
Jens
I made a pull request for a few things I forgot to include.
Have you had any time to look it over? Would you prefer it as a branch? Let me know.
Sorry about the late response.
I've converted mocha cakes into a proper Mocha interface, so I'll close this issue for now.
Very cool, will check it out again soon :]
Yea, it reduced quite a bit of complexity from the code base :)
Awesome job porting this project from CoffeeScript, I really liked it but was having trouble with using CoffeeScript to write my tests. I've modified the code slightly to clean the output a bit by giving the
Feature
a new line before it and removing the one after, but I'd really like to reduce the lines required for the step to a having no spaces, any idea how I can do this?