You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
769 B

  1. import React from "react";
  2. import renderer from "react-test-renderer";
  3. import App from "../App";
  4. jest.useFakeTimers();
  5. // NOTE: Just an toy example for verifying if Jest is running
  6. describe("Jest initialization test", () => {
  7. it("Knows how to sum", () => {
  8. expect(1 + 1).toBe(2);
  9. });
  10. });
  11. // NOTE: Testing a snapshot
  12. it('Renders correctly', () => {
  13. const tree = renderer.create(<App />).toJSON();
  14. expect(tree).toMatchSnapshot();
  15. });
  16. //FIXME:currently, I can't run the example that is in the expo documentation
  17. // -> https://docs.expo.io/guides/testing-with-jest/#unit-test
  18. // describe("<App />", () => {
  19. // it("has 1 child", () => {
  20. // const tree = renderer.create(<App />).toJSON();
  21. // expect(tree.children.length).toBe(1);
  22. // });
  23. // });