dimanche 6 mai 2018

Using flow inside jest test file results in undefined test, expect etc

I have a simple test.js file

// @flow
import React from "react";
import renderer from "react-test-renderer";
import RatioImage from "./";

test("<RatioImage /> base case should render correctly", () => {
  const tree = renderer.create(<RatioImage width={100} ratio={1} source= />);
  expect(tree).toMatchSnapshot();
});

Adding flow inside there works within renderer which is nice, however test and expect cause flow errors as they are not defined. Is there any way to set them as globals of some sort so flow doesn't error them?

Aucun commentaire:

Enregistrer un commentaire