tl;dr - JSDOM has updated so my testing code that uses it has updated as well, ignore the editorial and look at the code. A while ago, I wrote a bit about some code I often use for integration testing on the front end. Since “integration” can mean a lot of things, to clarify, I am referring to making sure components render the right HTML under certain states (not loading a full page, not testing the render function).
tl;dr I extend my UI component unit/integration testing methodology to do E2E tests. Look at the code, I basically add lots of nice context-setter-upper functions (that’s the official term) that makes it work and make it relatively clean. As hinted-to at the end (PS) of my previous post, recently after attempting (and succeeding, mostly) to set up full E2E testing in the backend of a haskell app I’m writing, I decided to switch to writing the tests in JS land (instead of Haskell land) due to some lack of library support for PhantomJS/Selenium.
tl;dr While the setup works, the most mature haskell library for dealing with webdrivers that I could find wasn’t able to keep up with the changes in Selenium Webdriver :(. Skim through the post to check out the relevant code snippets and tech that made it all (almost) work. If you’re not familiar with Haskell, check it out. This isn’t an introductory type post so it might not be for you, but the language is amazing.
Switching from Mocha to Tape & testing E2E Before reading this post, it might make sense to check out my previous posts on the topic: Part 1 - Unit testing with JSPM, Mocha, and Vue.js Part 2 - More testing with JSPM, Mocha, and Vue.js Part 3 - Testing the DOM Part 4 - Switching from mocha to tape BONUS Want to see it all working? Check out the gitlab repo with a fully-built example
Doing DOM-level tests with Mocha & VueJS (part 3…ish) Before reading this post, it might be helpful to check out my previous (or other) posts on the topic: Part 1 - Unit testing with JSPM, Mocha, and Vue.js Part 2 - More testing with JSPM, Mocha, and Vue.js Part 3 - Testing the DOM Part 4 - Switching from mocha to tape BONUS Want to see it all working?
Testing with Mocha and JSPM (and SystemJS), continued So after messing with my testing set up for a while, I found that there was a little more setup required to get my components to test properly with mocha. tldr; some more setup is required to get the code in the previous blog post to work properly, check it out below: Multi-part blog post alert This is a multi-part blog-post!