ember-vitest
v0.9.0
Published
integration for testing Ember with Vitest
Maintainers
Readme
ember-vitest
ember <-> vitest integration
- browser testing is first class
- pause test execution for UI debugging purposes (and without pausing JS execution)
- continue using familiar helpers as you would in qunit
Install
npm add --save-dev ember-vitest vitest @vitest/browser @vitest/browser-webdriverioThen configure vite. See Setup.
Usage
import { describe, expect, test } from "vitest";
import { render } from "ember-vitest";
import { Button } from "#src/components/ui/button.gts";
describe("Rendering | component | ui | button", () => {
test("forwards native disabled behavior", async () => {
const screen = await render(
<template>
<Button disabled>Unavailable</Button>
</template>,
);
await expect
.element(screen.getByRole("button", { name: "Unavailable" }))
.toBeDisabled();
});
});The documentation has:
- Vanilla Vitest (Vitest without this library)
- Core APIs:
renderandvisit - Additional testing styles:
setupContext,setupRenderingContext, and the extendedtest
The test report of this repository has the result and the trace of each test.
