Skip to content

Error while running Jest with rn-tooltip on my project.Β #96

@sanchitos

Description

@sanchitos

I am using the library, it works perfectly. Now I need to do some tests over my component.

My settings:

  • react: 18.2.0
  • react-native: 0.71.3
  • typescript: 4.8.2

I have this error:

Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

Details:

/Users/pepe/Code/chat/node_modules/rn-tooltip/src/Tooltip.js:3
import * as React from 'react';
^^^^^^

SyntaxError: Cannot use import statement outside a module

  2 | import { FC } from 'react';
  3 | import { StyleSheet, Text, View } from 'react-native';
> 4 | import Tooltip from 'rn-tooltip';

I have tried a lot of things in order to make it work. Any suggestion?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions