Golang Golang Unit testing with Gomega matcher A function result somehow needs to be compared in a unit test to know whether the function returns the expected value or... 2023.10.04 Golang
Golang Golang A good way to get struct data with gomega matcher It took me about 20 minutes to know the way to access a property in a struct that is passed by a channel in a unit test.... 2023.10.02 Golang
Python Python How to mock constructor with mockito for unit testing A class constructor directly needs to be called in a class in some cases. It might not be a good design but sometimes it... 2023.08.09 Python
Golang Golang Mock File System for unit testing by afero It's often problematic to create a test directory or file on the actual file system because they are need to be deleted after each test. Don't stop it. Let's use afero package to do it on the memory. 2023.07.17 Golang
Golang Golang 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.15 Golang
Python Python 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.25 Python
Python Python 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.14 Python
Python Python 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...? Passin... 2022.10.05 Python
Python Python 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.19 Python
JavaScript/TypeScript A 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.23 JavaScript/TypeScript