Questions tagged [babel-jest]

A Babel transpiler to assist with the conversion of ES6 to ES5 for the Jest testing framework.

A Babel plugin to assist ES6 to ES5 transpilation for the Jest testing framework.

607 questions
-1
votes
1 answer

Jest configuration to fix "Jest encountered an unexpected token" for import/export

I would like to run the following test with Jest. I have no babel-config or jest-config yet. How can I configure jest to use ES6 features like import/export? index.js: export const add = (a, b) => a + b; index.test.js import { add } from…
yN.
  • 1,847
  • 5
  • 30
  • 47
-1
votes
1 answer

Does Jest Support stealjs

Hello was trying to run canjs v2.3 for JEST but it seems it returns an error after testing: Reference: steal is not defined. I am not sure if bundling with stealjs is supported with Jest, I can't also find resources online regarding this ticket. I…
Bon Andre Opina
  • 2,129
  • 2
  • 15
  • 33
-1
votes
1 answer

Unexpected token, expected "{"

I am trying to set up jest to test my react code. but i am running into the above error, at the < for state in below line class app extends Component { this is my .babelrc file { "presets": [ "@babel/preset-env", …
-2
votes
1 answer

native ECMAScript module configuration file causes unit test to fail

I am using Vue 3 and Jest. I created a simple code to test as shown below. According to some posts on Stack Overflow, I modified the babel.config.js and package.json as shown below. When I run npm test I receive the error message posted below.…
Amrmsmb
  • 1
  • 27
  • 104
  • 226
-2
votes
1 answer

Error: Uncaught [TypeError: Cannot destructure property 'match' of 'props.value' as it is undefined.]

Here it's written header.js code and it's testing with jest framework. While im testing im getting the error property of match of props.value as it is undefined. When i compile , compiler shows this link to solve error but its not…
-2
votes
1 answer

React testing using shallow- Not able to call. props() and its subsequent functions since the component is controlled by a state

am just learning testing in React using shallow I have a parent Component and a child component The parent component has one state defined as: const [searchOpen, setSearchOpen] = useState(false); const performAnAction = () => { …
Coder
  • 69
  • 8
1 2 3
40
41