Pattern: Import of node:test
instead of vitest
Issue: -
Importing from node:test
instead of vitest
can lead to inconsistent test results and missing features. Using vitest
ensures compatibility and access to all testing functionality.
Example of incorrect code:
import { test } from "node:test";
import { expect } from "vitest";
test("foo", () => {
expect(1).toBe(1);
});
Example of correct code:
import { test, expect } from "vitest";
test("foo", () => {
expect(1).toBe(1);
});