GolangGolang How to mock an object by yourself for unit testing It might be too big to introduce a mock framework. It's better to create a mock object by ourselves in this case.2023.02.15Golang
PythonPython How to use fixture in pytest to share a function How can we write when we want to add a function that is executed for all tests, e.g. pre-process and post-process? If you want to know how to use fixture, this post is for you.2023.01.25Python
PythonPython mockito to stub an object for unit testing mockito in Python doesn't have good documentation due to poor examples. I struggled with it to learn how to do something. If you also in the same situation, this post is for you. Stub, replace a method behavior, and verify the parameters!2022.10.14Python
PythonPython How to pass a list to parametrize in Pytest I searched for a way to pass a list as a parameter but I didn't find the answer. Because it is too easy to do...? Pa...2022.10.05Python
PythonPython How to start unit tests with pytest This post is for those who want to start unit testing in Python with pytest. How should file name and function name look like? How can we compare results? What if the function throws an error? This post guides you to unit testing world!2022.09.19Python
JavaScript/TypeScriptA good way to write our own Node-RED node for the testability I have used Node-RED for more than 3 years for my working project. I came up with a good idea to write our own node for...2022.05.23JavaScript/TypeScript
JavaScript/TypeScriptTop-Level function cannot be stubbed if it is exported by an asterisk A top-level function is not a part of an object. If we need to stub it, we need to have an object that has the target f...2022.05.04JavaScript/TypeScript
JavaScript/TypeScriptWhat is the difference between Stub and Mock In a unit test, we need to replace a real behavior with a test object but the variable name is sometimes xxxxStub for m...2022.04.29JavaScript/TypeScript
JavaScript/TypeScriptTypeScript Stub Date and timer friends functions with sinon When Date class, timer friends functions like setTimeout, and setInterval are used in a function, we need to control th...2022.04.15JavaScript/TypeScript
JavaScript/TypeScriptHow to determine test values for unit testing Are you a beginner at unit testing? Are you not confident enough to choose the test cases? You are not alone. Let's lea...2022.04.04JavaScript/TypeScript