O'Reilly logo

Learning Node.js for .NET Developers by Harry Cummings

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Full-stack testing with PhantomJS

We have now written unit tests for logic at the core of our application and integration tests for our server-side routes. We don't yet have any automated tests that cover our views and client-side scripts as our manual testing throughout the previous chapters did.

We can write unit tests for client-side scripts using Mocha. However, all of our current client-side scripts interact with the server, so aren't good candidates for unit testing. Our manual tests are really full-stack tests of our whole application, including the interaction between the server and the client.

In order to achieve this in an automated test, we will need to use some form of browser automation. PhantomJS is a headless browser with a JavaScript ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required