testing

How to test a custom React hook component

· Reading time: ~3 minute(s) (624 words) programming javascript react testing

As part of my GameBrowser side-project, I’m at the stage where I wanted to start improving the UI a bit. This included needing to define a way of filtering the servers in the list, because they’re all saved together at the moment. As a first attempt, I opted for a simple Dropdown control and decided to make it generic using a custom React Hook. The result was the creation of useDropdown. (Continue reading)

Moq - Setup Mock method specifying parameters of type

· Reading time: ~2 minute(s) (255 words) csharp programming testing moq

When working on my GameBrowser project this evening, I wanted to verify that a method setup on a mock object had been called when a property of the parameter object was a particular value. (Continue reading)

React.js Unit Testing with Jest and Enzyme

· Reading time: ~3 minute(s) (524 words) programming javascript reactjs testing

I've written loads of unit tests in my lifetime for C# and JavaScript, but never gotten around to writing any for testing the actual React components because there's always been something more pressing. Time to put that right and take the plunge. (Continue reading)