react18-tools/react-mouse-trail

View on GitHub
scripts/templates/hook.test.hbs

Summary

Maintainability
Test Coverage
import { cleanup, renderHook, act } from "@testing-library/react";
import { afterEach, describe, test } from "vitest";
import { {{ camelCase name }} } from "./{{ kebabCase name }}";

describe.concurrent("{{ camelCase name }}", () => {
    afterEach(cleanup);

    test("Dummy test - test if renders without errors", ({ expect }) => {
        const { result } = renderHook(() => {{ camelCase name }}());
    act(() => result.current.setValue(10));
    expect(result.current.value).toBe(10);
    });
});