In my create-react-app app (not Typescript) I use jest for tests. With 7.0.1 this works, but with 8.0.2 tests fail for components that use react-debounce-render.
Perhaps this is a jest configuration issue, but I still like to ask if react-debounce-render has been packaged/built/minified the right way in the npm package?
The reason I'm asking is the output from the test and the actual source in node_modules\react-debounce-render:
Jest encountered an unexpected token
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.
....
C:\dev\app\node_modules\react-debounce-render\dist\index.js:1
({"Object.":function(module,exports,require,__dirname,__filename,jest){import React, { Component } from 'react';
^^^^^^
SyntaxError: Cannot use import statement outside a module
I compared the old version's node_modules\react-debounce-render\lib\index.js and it is very different. It does not import React but starts like this:
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = exports.debounce = void 0;
Thanks!
In my create-react-app app (not Typescript) I use jest for tests. With 7.0.1 this works, but with 8.0.2 tests fail for components that use react-debounce-render.
Perhaps this is a jest configuration issue, but I still like to ask if react-debounce-render has been packaged/built/minified the right way in the npm package?
The reason I'm asking is the output from the test and the actual source in
node_modules\react-debounce-render:I compared the old version's
node_modules\react-debounce-render\lib\index.jsand it is very different. It does notimport Reactbut starts like this:Thanks!