A Guide to Generating Boring Code with Node

Writing boring code is not fun. Especially if that code is just a derivative of some data. You should generate it instead! A great example is to generate your HTTP client code from an API definition. This is actually very easy to do with a recent node version and requires almost no extra dependencies. In this post I will show you how to take a JSON schema definition and generate some validation logic from that.

Read more

How to Keep flowtype Running and Report Errors on Save

We use flow from Facebook to run type checking on our codebase. When you run ‘flow status’ it starts a flow server in the background and keeps it running. That way after the first run the results of each next run are almost instant. The only thing currently lacking is a watch mode, but there is a nice trick you can use.
Read more

Testing Promises with Mocha

If you test Javascript promises with Mocha, there are several styles you can use to write your tests. If you follow the Mocha docs on testing asynchronous code you risk writing 'evergreen' tests. Evergreen tests never fail, even if your code is broken. That is something you clearly do not want to happen. So what is the safest way to write asynchronous tests with Mocha?
Read more

Automated UI Testing with React Native on iOS

React Native is a technology to develop mobile apps on iOS and Android that have a near-native feel, all from one codebase. It is a very promising technology, but the documentation on testing can use some more depth. There are some pointers in the docs but they leave you wanting more. In this blog post I will show you how to use XCUITest to record and run automated UI tests on iOS.
Read more →