chrome-api | Polyfills , libraries and patches to aid Chrome extension | Browser Plugin library
kandi X-RAY | chrome-api Summary
kandi X-RAY | chrome-api Summary
Polyfills, libraries and patches to aid Chrome extension developers.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of chrome-api
chrome-api Key Features
chrome-api Examples and Code Snippets
Community Discussions
Trending Discussions on chrome-api
QUESTION
I'm trying to debug my typescript tests in a React app, using ts-jest
.
My project was generated with create-react-app
.
I can run my typescript tests perfectly with the provided "test": "react-scripts-ts test --env=jsdom"
But for debugging them I'm trying adding a script entry in package.json like this:
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --config=jest.config.debug.json"
When I run this like: npm run test:debug
I get the expected message:
Debugger listening on ws://127.0.0.1:9229/bc733a7d-01d8-42eb-a18d-e59fe30a6393
But when I connect with Chrome DevTools, I click run and then, many of my tests run and pass, but I get this error when running perhaps the only test I made in a .test.tsx file.
ANSWER
Answered 2018-Dec-17 at 09:00In your Jest config, you need to stub some files that Jest doesn't understand.
https://jestjs.io/docs/en/webpack
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'/config/jest/mock/fileMock.js',
'\\.(css|less)$': 'identity-obj-proxy',
}
fileMock.js:
module.exports = 'test-file-stub';
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install chrome-api
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page