Mocking Questions

Ad

Mocking method results

I'm trying to find a way to fake the result of a method called from within another method. i have a "loaddata" method which calls a
Ad
Ad
Ad

Mocking API call in JS

I need to mock api calls for a button click but the actual call is nested down in a utility file that is called by a middleware file. some
Ad
Ad

How to replace a class?

I am writing test files for a python module class a: def func(self): b().sub_func() class b: def sub_func(self):

How to mock init of helper class

I am having trouble with checking if an object is being constructed with the proper params from another instance of an object. in the below

Jest mocks in test util

I'm using a __mocks__ folder to mock a node_module. nice. example to one of the mocks, that mock 'react-relay':
Ad

Mockiito wrong return value?

Hello i have 2 tests for newinstance() method fragment. but it looks like i'm doing something wrong, because mockito is ignoring my

Mock new Function() with Jest

I'm having trouble trying to mock a module with a constructor // code.js const serviceclass = require('service-library'); const
Ad

Not able to mock a method

I have this code i want to test in isolation in some_module.py import tarfile def function_to_test(path_to_tar): tar_file =

Spy on imported function

I want to spy on a function that is executed as soon as the file is required. in the example below i want to spy on bar. i have the following

Jest Asynchronous API Mocking

I have searched this issue on stack-overflow, but couldn't find anything similar to me use case. i have container component like this.
Ad
Ad
Ad

Blog Categories

Ad