Unit tests can be great to verify your source code, but there are times when integration tests provide a more useful report on the stability of your application. Yes, integration tests (most likely) require more setup than unit tests, and yes, they will (again, most likely) test things outside of the code you wrote. But they also come with a huge upside in that they test what your customers will use — the end product stack. And including integration tests in your continuous integration builds can track how that experience functions over time. Successful integration tests provide you with a real sense that your application performs correctly from end to end.
Although there are many possible integrations to test within an application, I’d like to focus on testing at the UI layer. Within the Node.js environment, there are (of course) many options available to you. One of the more popular tools to assist in UI testing is PhantomJS. PhantomJS is not, however, a test tool but instead a headless WebKit, and requires a testing framework which may need additional configuration. In some cases this might be necessary, but in other cases, a simpler solution is all that’s required. Zombie.js provides that with very minimal setup and an intuitive interface for your UI testing needs.
Your new post is loading...