diff --git a/test/TestOver.ts b/test/TestOver.ts index 0e59a8d..adbe2e6 100644 --- a/test/TestOver.ts +++ b/test/TestOver.ts @@ -84,6 +84,7 @@ describe('example properties', () => { return text.length > 0; }); }, { + examples: [''], // error formatting can be overridden with a custom handler, or fast-check's default errorReporter: defaultReportMessage, }, itFails('after 1 tests', done)); diff --git a/test/helpers.ts b/test/helpers.ts index 4e361f9..3316710 100644 --- a/test/helpers.ts +++ b/test/helpers.ts @@ -4,12 +4,12 @@ export function itFails(msg: string, done: Mocha.Done, count = 1): Mocha.TestFun const expectations: Array = []; const mockIt = function (this: Mocha.Context, name: string, test: Mocha.AsyncFunc) { - console.log('mock it invoked with test', name, test.name, expectations.length); + console.log(`mock it invoked for '${name}' with test '${test.name}', ${expectations.length} of ${count}`); expectations.push(expect(test.call(this), name).to.eventually.be.rejectedWith(Error, `Property failed ${msg}`)); if (expectations.length >= count) { - console.log('all expectations queued for', name, expectations.length); + console.log(`all ${expectations.length} expectations queued for '${name}'`); Promise.all(expectations).then((_val) => done(), (err) => done(err)); } @@ -22,12 +22,12 @@ export function itPasses(done: Mocha.Done, count = 1): Mocha.TestFunction { const expectations: Array = []; const mockIt = function (this: Mocha.Context, name: string, test: Mocha.AsyncFunc) { - console.log('mock it invoked with test', name, test.name, expectations.length); + console.log(`mock it invoked for '${name}' with test '${test.name}', ${expectations.length} of ${count}`); expectations.push(expect(test.call(this), name).to.eventually.be.oneOf([true, undefined])); if (expectations.length >= count) { - console.log('all expectations queued for', name, expectations.length); + console.log(`all ${expectations.length} expectations queued for '${name}'`); Promise.all(expectations).then((_val) => done(), (err) => done(err)); }