I know this has been asked countless times, but I am not able to fix the problem inspite of following all the SO solutions and suggestions.   I came to know about jest a few days ago and tried to have my hands on it. There is a good tutorial mentione...
I have spent a long time looking at other questions about this and looking at other projects on Github but none of the answers seem to work for me.  I am loading a third party library in my project, and when running Jest tests I get the error  export...
Is there any way in Jest to mock global objects, such as navigator, or Image*? I've pretty much given up on this, and left it up to a series of mockable utility methods. For example:  // Utils.js export isOnline() {     return navigator.onLine; }...
I have migrated my app to babel 7 beta and everything seems to work except the tests. I think I've read everything out there but I'm still getting this error:     ? Test suite failed to run  Requires Babel "^7.0.0-0", but was loaded w...
I'm still facing problems trying to use jest, typescript and es6 modules. My test are written in Typescript, I'm trying to import objects from js-file which uses es6 modules. To do that, I've followed jest documentation and have the follo...
I found a similar problem here, but there doesn't seem to be an answer.  I'm trying to test an ES6 class using Jest, like so:  // src/myclass.js export default class MyClass {     constructor(options) {         // currently this is empty whil...
I'm trying to mock only one function in imported React module, keep the rest of the module unmocked and do this at top level for all tests.  I'm using fresh create-react-app project with a single test to observe the problem.  Steps to reprodu...
I have a vue.js application, and I installed Jest using these instruction:  https://vue-test-utils.vuejs.org/guides/testing-single-file-components-with-jest.html.   when I run npm test, I get the error.  ? Test suite failed to run  TypeError: Cannot...
After migrating to Babel 7 when I launch my tests I get this error  TypeError: Cannot read property 'default' of undefined  for this line (e.g. index.js file):  export { default } from './SearchInput';  Where SearchInput.jsx file is i...
I have a bunch of files that are configuring my Jest tests. I need them to specify environment for Puppeteer browser and setup/teardown behaviours.   module.exports = {    globalSetup: './jest-config/setup.js',    globalTeardown: './jest-...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.