vendredi 18 janvier 2019

How to test a function that has been passed by props

If I have a component like this

import React from "react";

const GettingStarted = ({ object }) => <Button onPress={() => object.next()} />;

How would you test with jest that object.next() gets called inside the component?

Aucun commentaire:

Enregistrer un commentaire