Git Product home page Git Product logo

proptests-workshop's Introduction

Proptests Workshop

For an overview of built-in arbitraries, see fast-check's documentation

Proptests for mergeSort

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.

  1. Complete the proptest for the hasTheSameLength property
  2. Increase the number of runs for the hasTheSameLength property to 10,000 (you can pass an options object as the second argument to fc.assert)
  3. Try to come up with another property for the mergeSort function

Proptest for React component

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:

  1. In apps/web/test-utils/arbitraries.ts add the missing fields for the nodeArbitrary. Then use the nodeArbitrary in the repositoriesContributedToArbitrary. Finally, complete the contributionsQueryArbitrary.

  2. In /apps/web/components/__tests__/ContributionList.tests.tsx add checks to the itDoesNotCrash property to get the proptest working.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.