Why is DOM-Centric JavaScript Hard to Test?


A lens from microscope used in medical laboratoryWhile producing my recent course on Large Scale JavaScript, I was digging into the testability of JavaScript. So much of the JavaScript I see out there continues to be jQuery driven, DOM-centric JavaScript.

Sure, many of my readers are moving towards AngularJS, Ember and other client-side libraries that encourage modularization, testability, and separation of concerns, but not all web developers are. Ultimately we need to test our JavaScript no matter what the nature of it is.

In this video excerpt from my course, I discuss why DOM-Centric JavaScript is so difficult to test:

Do you agree?



Shawn
Shawn Wildermuth
Author, Teacher, and Coach



My Courses

pluralsight
Building a Web App with ASP.NET Core, MVC6, EF Core, Bootstrap and Angular (updated for 2.0)
Using Visual Studio Code for ASP.NET Core Projects (new)
Implementing and Securing an API with ASP.NET Core
Building a Web App with ASP.NET Core, MVC6, EF Core and AngularJS
Building a Web App with ASP.NET5, MVC6, EF7, and AngularJS (Retired)
Best Practices in ASP.NET: Entities, Validation, and View Models
Webstorm Fundamentals
Front-End Web Development Quick Start
Lessons from Real World .NET Code Reviews
Node.js for .NET Developers

Application Name WilderBlog Environment Name Production
Application Ver 2.0.0.0 Runtime Framework .NETCoreApp,Version=v2.0
App Path D:\home\site\wwwroot\ Runtime Version .NET Core 4.6.26020.03
Operating System Microsoft Windows 10.0.14393 Runtime Arch X86