describe()
Groups related tests into a test suite. Helps organize tests by feature or component.
Syntax
testing
describe("suite name", () => { /* tests */ })Example
testing
describe("UserService", () => {
it("creates a user", () => {
expect(createUser("Alice")).toHaveProperty("name", "Alice");
});
it("throws on empty name", () => {
expect(() => createUser("")).toThrow("Name required");
});
});