Treat test code as application code by linting
summary
Argues that treating test code like production code and linting it improves maintainability and reduces flakiness, and demonstrates Java/JavaScript stats (Java 66% prefer spaces, JavaScript ~80% prefer four spaces, quotes ~50/50). Uses ESLint (Airbnb), Checkstyle, SonarQube plus a custom Sonar webdriver plugin and a protractor ESLint plugin, runnable in IDE, CLI and CI. The Sonar plugin scans test sources and successfully flags hard sleeps, missing assertions, bad locators, empty catches, and actions without perform.
AI-written summary · about
chapters (7)
- 0:00Start
- 0:46What Is Linting
- 1:52Why Do We Want Static Code Analysis Code
- 5:05Line Length
- 7:24What Does It Mean for Test Code
- 19:00Webdriver Plugin
- 26:12Key Takeaways
related talks
30mWait, before you write your next test...
02mSummit Report: Linting best practices
14mAnalyze your code with SonarLint for IntelliJ
25mWrite Perfect Code with Standard and ESLint
07mWho Guards the Guards? – Finding Bugs in Your Tests
36mEnforcing coding standards in a JS library
14mGetting Started with JavaScript Linter | What Is Linter?
29mBuilding Accessibility Testing into Your Workflow
