Rules
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
it('lets me change the selected option', () => {
const container = render(MySelect, {
props: { options: [1, 2, 3], selected: 1 },
});
expect(container).toBeDefined();
expect(container.toHTML()).toContain('<option value="1" selected>');
container.setProp('selected', 2);
});it('lets me change the selected option', () => {
const container = render(MySelect, {
props: { options: [1, 2, 3], selected: 1 },
});
expect(container).toBeDefined();
expect(container.toHTML()).toContain('<option value="1" selected>');
container.setProp('selected', 2);
expect(container.toHTML()).not.toContain('<option value="1" selected>');
expect(container.toHTML()).toContain('<option value="2" selected>');
});Popular · 1 of 50
Prefer having the last statement in a test be an assertion
it('lets me change the selected option', () => {
const container = render(MySelect, {
props: { options: [1, 2, 3], selected: 1 },
});
expect(container).toBeDefined();
expect(container.toHTML()).toContain('<option value="1" selected>');
container.setProp('selected', 2);
});it('lets me change the selected option', () => {
const container = render(MySelect, {
props: { options: [1, 2, 3], selected: 1 },
});
expect(container).toBeDefined();
expect(container.toHTML()).toContain('<option value="1" selected>');
container.setProp('selected', 2);
expect(container.toHTML()).not.toContain('<option value="1" selected>');
expect(container.toHTML()).toContain('<option value="2" selected>');
});