Describing Tests
- Label tests with descriptive texts rather than function names
describe('sorting the list of users', function() { it('sorts in descending order by default', function() { ... }); });
describe('sorting the list of users', function() { it('sorts in descending order by default', function() { ... }); });
expect(isLeapYear(2000)).toBe(true);
E2E | Unit |
---|---|
E2E tests interact with the app interface, just as a user does. | Unit tests interact with the app code. They call app functions, look at app data structures. |
E2E tests can slow, waiting for server, browser, and network responses. | Unit tests should blazingly fast, fractions of a second. |
A well-tested app will have hundreds of E2E tests. | A well-tested app will have thousands of unit tests. |
toString
Thanks to Hakim El Hattab for RevealJS