diff options
Diffstat (limited to 'pbt/ts/src/property.test.ts')
| -rw-r--r-- | pbt/ts/src/property.test.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pbt/ts/src/property.test.ts b/pbt/ts/src/property.test.ts index 920457a..addff34 100644 --- a/pbt/ts/src/property.test.ts +++ b/pbt/ts/src/property.test.ts @@ -7,18 +7,18 @@ import { } from './property'; // from https://github.com/jlink/shrinking-challenge/blob/main/challenges/difference.md -const predicate1: (pair: [number, number]) => boolean = ([x, y]) => - x < 10 || x !== y; +const predicate1: (pair: [number, number]) => Promise<boolean> = ([x, y]) => + Promise.resolve(x < 10 || x !== y); describe('Find minimal counterexample', () => { - test('do not shrink example if no shrinker given', () => { - const result = property(pairOf(positiveInt), predicate1)(42, 1); + test('do not shrink example if no shrinker given', async () => { + const result = await property(pairOf(positiveInt), predicate1)(42, 1); expect(result.result).toBe('Falsified'); expect(result.counterexample).toBeNull; }); - test('shrink example if shrinker given', () => { - const result = property( + test('shrink example if shrinker given', async () => { + const result = await property( pairOf(positiveInt), predicate1, shrinkPair(shrinkPositive, shrinkPositive), |
