microsoft / TypeScript-React-Native-Starter

A starter template for TypeScript and React Native with a detailed README describing how to use the two together.
MIT License
1.91k stars 211 forks source link

Example test for Hello.tsx does not work #10

Open stabenfeldt opened 6 years ago

stabenfeldt commented 6 years ago

I'm following the guide from https://github.com/Microsoft/TypeScript-React-Native-Starter#adding-a-component but when I run npm test I get this error:


 FAIL  src/components/__tests__/Hello.tsx
  ● Test suite failed to run

    xx/src/components/__tests__/Hello.tsx: Unexpected token (9:35)
         7 | const Hello_1 = require("../Hello");
         8 | it('renders correctly with defaults', () => {
      >  9 |     const hello = enzyme_1.shallow(<Hello_1.default name="World"/>);
           |                                    ^
        10 |     expect(hello.find(react_native_1.Text).render().text()).toEqual("Hello World!");
        11 | });

Any idea what's wrong? My packages.json