use JSON.stringify to format counterexamples
This commit is contained in:
parent
d9d06eb469
commit
9ed06889f4
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mocha-foam",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"main": "out/src/index.js",
|
||||
"author": "ssube <seansube@gmail.com>",
|
||||
"license": "MIT",
|
||||
|
|
|
@ -82,13 +82,7 @@ export function briefReporter<T>(details: RunDetails<[T]>): string {
|
|||
*/
|
||||
export function formatExamples<T>(details: RunDetails<[T]>): string {
|
||||
if (details.counterexample !== null) {
|
||||
const examples = details.counterexample.map((val) => {
|
||||
if (isString(val)) {
|
||||
return `'${val}'`;
|
||||
} else {
|
||||
return val;
|
||||
}
|
||||
}).join(',');
|
||||
const examples = details.counterexample.map((val) => JSON.stringify(val)).join(',');
|
||||
return `failing on: ${examples} (seed: ${details.seed}, path: '${details.counterexamplePath}')`;
|
||||
} else {
|
||||
return `without counterexamples (seed: ${details.seed})`;
|
||||
|
|
Loading…
Reference in New Issue