-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
The way I use it:
import { expect, test } from "vitest";
import { render } from "vitest-browser-svelte";
import Checkbox from "./Checkbox.svelte";
test("Checkbox check", async () => {
const form = document.createElement("form");
document.body.appendChild(form);
const screen = render(
Checkbox,
{ checked: true, name: "agreed" },
{ baseElement: form },
);
const formData = new FormData(form);
expect(formData.get("agreed")).toStrictEqual("on");
});
This works fine for a single test, but as soon as I add a second test, the cleanup for the first test fails with this error:
NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
Here's a repo with the tests:
https://github.com/samausir/base-element
simonhauck
Metadata
Metadata
Assignees
Labels
No labels