SyntaxError - node_modules/react-native/Libraries/polyfills/error-guard.js: Falta de ponto-e-vírgula. (14:4) sobre a execução de brincadeira em reagir nativo biblioteca

0

Pergunta

Eu estou tentando configurar uma brincadeira para reagir nativo biblioteca, mas eu estou ficando abaixo erro

SyntaxError: react-native/Libraries/polyfills/error-guard.js: Missing semicolon. (14:4)

      12 | let _inGuard = 0;
      13 |
    > 14 | type ErrorHandler = (error: mixed, isFatal: boolean) => void;
         |     ^
      15 | type Fn<Args, Return> = (...Args) => Return;

reagir versão nativa : 0.61.5

app.js

import { Dimensions } from 'react-native';

function sum(a, b) {
    return a + b;
}
module.exports = sum;

app.test.js

const sum = require('./app');

test('adds 1 + 2 to equal 3', () => {
  expect(sum(1, 2)).toBe(3);
});

jest.config.js

module.exports ={
    preset : 'react-native',
    transformIgnorePatterns: [
        '/node_modules/(?!(@react-native|react-native)/).*/'
    ]
}

.babelrc

{
    "presets": ["react-native"]
}

Eu tentei várias soluções sugeridas como a adição de transformIgnorePatterns, mas sem sucesso. alguém pode me ajudar aqui ?

javascript jestjs react-native reactjs
2021-11-23 11:38:02
1

Melhor resposta

0

Ele trabalhou para mim depois que eu mudei o .babelrc para arquivo babel.config.js.

2021-11-25 07:14:00

Em outros idiomas

Esta página está em outros idiomas

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................