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
hasTheSameLengthproperty - Increase the number of runs for the
hasTheSameLengthproperty 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.tsadd the missing fields for thenodeArbitrary. Then use thenodeArbitraryin therepositoriesContributedToArbitrary. Finally, complete thecontributionsQueryArbitrary. -
In
/apps/web/components/__tests__/ContributionList.tests.tsxadd checks to theitDoesNotCrashproperty to get the proptest working.