Unit Test

Sponsored links
JavaScript/TypeScript

Make an Event Listener test simpler by Promise

A unit test should test only one thing but there might be some cases that a test checks multiple things because those va...
JavaScript/TypeScript

How to write annoying unit tests

A unit test should be clear enough. To make it concise, the tests are refactored. It looks good at first but some of them trouble us as the software grows. Let's understand those ways to cause problems.
JavaScript/TypeScript

Testing a function specified in callback that cannot be triggered in test

Don't you have a good idea to write a test of the logic specified in a callback function? Isn't it possible to control t...
JavaScript/TypeScript

Node-RED node test fails when using sinon.useFakeTimer

Node-RED test fails when replacing timer related functions. Our own node derives Node-RED node and it calls setImmediate...
JavaScript/TypeScript

How to write Node-RED flow test

Testing the whole Node-RED flow is important but adding test flows is not a good idea. Test stuff should exist only in the test code. This post explains how to write Node-RED flow tests in JavaScript/TypeScript code.
JavaScript/TypeScript

How to write unit tests for a singleton class

Once a static field value changes in unit tests, the change applies to other tests because it's static. It's important to split it into two classes. One class has the main logic and the other stores the class to provide it as singleton.
JavaScript/TypeScript

How to write good unit tests?

Unit Test makes your software better in terms of not only quality but also class structure because you need to separate ...
Sponsored links