The Power of One Test
A developer experience and quality control measure I take on programs I’m building, even small ones, is always to write at least one test. Here’s an example, from this blog: // cypress/e2e/index.cy.js it('shows the homepage', () => { cy.visit('/'); cy.get('article').should('have.length', 10); }); The test loads the homepage and confirms ten articles. The test framework, Cypress, is inconsequential– the point is the test. Should we write tests? What kind, and how many? It’s easy to overthink it; don’t. The difference between zero tests and one is massive. ...