Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Expo TypeScript Tabs Snapshot Test App.tsx

$
0
0

I initialized a default Expo project using Typescript and Tabs option.

Follow these directions (https://docs.expo.io/get-started/create-a-new-app/) and select the Typescript with Tabs option.

Then I tried to follow the directions for creating a unit test here: https://docs.expo.io/guides/testing-with-jest/?redirected

I can't for the life of me figure out how to get this test to work:

import React from 'react';import renderer from 'react-test-renderer';import App from './App';describe('<App />', () => {  it('has 1 child', () => {    const tree = renderer.create(<App />).toJSON();    expect(tree.children.length).toBe(1);  });});

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>