Questions tagged [test-double]

22 questions
0
votes
0 answers

Using testdouble I want to replace a dependency

In my code, I am using the library jsonwebtoken. To expedite the testing process, I would like to replace the library with a fake dependency using testdouble. To test the creation of my fake dependency, I replaced the functionality of the sign…
pythonNovice
  • 1,130
  • 1
  • 14
  • 36
0
votes
0 answers

How can I replace a function with a testdouble function?

I would like to test a file with testdouble. However, I have a method helperFunc that I am unsure how to mock in the file here. If it were a class method, I would use MyClass.prototype.method = td.func() but here I tried using const helperFunc =…
pythonNovice
  • 1,130
  • 1
  • 14
  • 36
0
votes
1 answer

Does stub make tests fragile?

suppose our SUT(Class A) has a dependency(IDependency) and we create stub with canned answer for some operations(Method A that return bool value). in this manner we reveal some implementation details of SUT (SUT Using Method A) and if we want…
ihsan
  • 59
  • 9
0
votes
0 answers

Python: Dummy or Stub?

The question is about the classic topic of different test doubles. I only have some naming problems about this code snippet: @pytest.fixture(autouse=True) def setup(self): class DummyModel: id = "model_id" changes = {} …
MattSom
  • 2,097
  • 5
  • 31
  • 53
0
votes
1 answer

golang test spy incorrectly comparing equality

I'm in the process of learning go and am adapting a Java Game of Life example from testdouble. However, the test spy I have written incorrectly compares equality of my World struct - the test passes when it should fail, since output(world) is not…
junglie85
  • 1,243
  • 10
  • 30
0
votes
1 answer

An example (or several) about method at() in phpunit

Would anybody, please, show me an example for at method in phpunit test doubles. I don't understand what is its purpose?
jjoselon
  • 2,641
  • 4
  • 23
  • 37
0
votes
3 answers

What is the Kotlin philosophy of test doubles?

What is the Kotlin philosophy of test doubles? With all classes and functions being sealed by default (not open), mocking frameworks like Mockito are clearly not first-class citizens. A lot has already been written about the problem, and also about…
Niel de Wet
  • 7,806
  • 9
  • 63
  • 100
1
2