For an overview of built-in arbitraries, see fast-check's documentation
In /packages/utils/__tests__/sort.tests.ts
you will find a unit test for an implementation of mergeSort.
In addition, there's a start for a proptest for the hasTheSameLength
property as discussed during the presentation.
- Complete the proptest for the
hasTheSameLength
property - Increase the number of runs for the
hasTheSameLength
property to 10,000 (you can pass an options object as the second argument tofc.assert
) - Try to come up with another property for the mergeSort function
In /apps/web/components/__tests__/ContributionList.tests.tsx
you will find two integration tests: one with a conventional mock (in the form of json data)
and the beginning for a proptest which tests the "it doesn't crash" property.
Complete the following steps to get the proptest working for the React component:
-
In
apps/web/test-utils/arbitraries.ts
add the missing fields for thenodeArbitrary
. Then use thenodeArbitrary
in therepositoriesContributedToArbitrary
. Finally, complete thecontributionsQueryArbitrary
. -
In
/apps/web/components/__tests__/ContributionList.tests.tsx
add checks to theitDoesNotCrash
property to get the proptest working.