1
0
Fork 0

better string formatting

This commit is contained in:
ssube 2021-07-21 00:17:39 -05:00
parent 6bec31e4d1
commit 3383718aac
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 2 additions and 3 deletions

View File

@ -13,11 +13,10 @@ export function over<T>(name: string, strategy: Arbitrary<T>, suite: Suite<T>):
return new Promise((res, rej) => {
const result = check(property(strategy, (t) => test.call(ctx, t)));
if (result.failed) {
console.log(result);
if (result.counterexample !== null) {
const examples = result.counterexample.map(it => {
if (typeof it === 'string' && it.length === 0) {
return "''";
if (typeof it === 'string') {
return `'${it}'`;
} else {
return it;
}