diff --git a/package.json b/package.json index 2689543..4e2e35a 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ ], "scripts": { "lint": "eslint . --ext .js,.mjs --cache", - "test": "npm run lint && ava -v" + "test": "npm run lint && node --test" }, "eslintConfig": { "extends": ".", @@ -64,7 +64,6 @@ "eslint-plugin-unicorn": "^47.0.0" }, "devDependencies": { - "ava": "^5.2.0", "eslint": "^8.40.0", "typescript": "^5.0.4" }, diff --git a/test/default.test.mjs b/test/default.test.mjs index 0706c2b..a8b3375 100644 --- a/test/default.test.mjs +++ b/test/default.test.mjs @@ -1,11 +1,13 @@ -import test from "ava"; +import test from "node:test"; +import assert from "node:assert"; + import { ESLint } from "eslint"; import config from "../index.js"; const isObject = (value) => value && typeof value === "object" && value.constructor === Object; -test("load config in eslint to validate all rule syntax is correct", async (t) => { +test("load config in eslint to validate all rule syntax is correct", async () => { const linter = new ESLint(); const code = ` const foo = 1; @@ -13,13 +15,13 @@ test("load config in eslint to validate all rule syntax is correct", async (t) = bar(foo); `.replaceAll("\t", ""); const [{ errorCount }] = await linter.lintText(code); - t.is(errorCount, 0); + assert.equal(errorCount, 0); }); -test("test basic properties of config", (t) => { +test("test basic properties of config", () => { const { env, plugins, rules } = config; - t.true(isObject(env)); - t.true(Array.isArray(plugins)); - t.true(isObject(rules)); + assert.ok(isObject(env)); + assert.ok(Array.isArray(plugins)); + assert.ok(isObject(rules)); }); diff --git a/test/react-typescript.test.mjs b/test/react-typescript.test.mjs index 44deb31..6800da9 100644 --- a/test/react-typescript.test.mjs +++ b/test/react-typescript.test.mjs @@ -1,11 +1,13 @@ -import test from "ava"; +import test from "node:test"; +import assert from "node:assert"; + import { ESLint } from "eslint"; import config from "../react-typescript.js"; const isObject = (value) => value && typeof value === "object" && value.constructor === Object; -test("load config in eslint to validate all rule syntax is correct", async (t) => { +test("load config in eslint to validate all rule syntax is correct", async () => { const linter = new ESLint({ overrideConfigFile: "react-typescript.js", overrideConfig: { rules: { "import/no-unresolved": "off" } } }); const code = ` import ReactDOM from "react-dom"; @@ -14,12 +16,12 @@ test("load config in eslint to validate all rule syntax is correct", async (t) = ReactDOM.render(element, document.querySelector("#root")); `.replaceAll("\t", ""); const [{ errorCount }] = await linter.lintText(code); - t.is(errorCount, 1); + assert.equal(errorCount, 1); }); -test("test basic properties of config", (t) => { +test("test basic properties of config", () => { const { plugins, rules } = config; - t.true(Array.isArray(plugins)); - t.true(isObject(rules)); + assert.ok(Array.isArray(plugins)); + assert.ok(isObject(rules)); }); diff --git a/test/react.test.mjs b/test/react.test.mjs index 088d74f..407d081 100644 --- a/test/react.test.mjs +++ b/test/react.test.mjs @@ -1,11 +1,13 @@ -import test from "ava"; +import test from "node:test"; +import assert from "node:assert"; + import { ESLint } from "eslint"; import config from "../react.js"; const isObject = (value) => value && typeof value === "object" && value.constructor === Object; -test("load config in eslint to validate all rule syntax is correct", async (t) => { +test("load config in eslint to validate all rule syntax is correct", async () => { const linter = new ESLint({ overrideConfigFile: "react.js", overrideConfig: { rules: { "import/no-unresolved": "off" } } }); const code = ` import ReactDOM from "react-dom"; @@ -14,13 +16,13 @@ test("load config in eslint to validate all rule syntax is correct", async (t) = ReactDOM.render(element, document.querySelector("#root")); `.replaceAll("\t", ""); const [{ errorCount }] = await linter.lintText(code); - t.is(errorCount, 0); + assert.equal(errorCount, 0); }); -test("test basic properties of config", (t) => { +test("test basic properties of config", () => { const { env, plugins, rules } = config; - t.true(isObject(env)); - t.true(Array.isArray(plugins)); - t.true(isObject(rules)); + assert.ok(isObject(env)); + assert.ok(Array.isArray(plugins)); + assert.ok(isObject(rules)); }); diff --git a/test/typescript.test.mjs b/test/typescript.test.mjs index eb0966a..6fc700a 100644 --- a/test/typescript.test.mjs +++ b/test/typescript.test.mjs @@ -1,11 +1,13 @@ -import test from "ava"; +import test from "node:test"; +import assert from "node:assert"; + import { ESLint } from "eslint"; import config from "../typescript.js"; const isObject = (value) => value && typeof value === "object" && value.constructor === Object; -test("load config in eslint to validate all rule syntax is correct", async (t) => { +test("load config in eslint to validate all rule syntax is correct", async () => { const linter = new ESLint({ overrideConfigFile: "typescript.js" }); const code = ` const foo = 1; @@ -13,12 +15,12 @@ test("load config in eslint to validate all rule syntax is correct", async (t) = bar(foo); `.replaceAll("\t", ""); const [{ errorCount }] = await linter.lintText(code); - t.is(errorCount, 1); + assert.equal(errorCount, 1); }); -test("test basic properties of config", (t) => { +test("test basic properties of config", () => { const { plugins, rules } = config; - t.true(Array.isArray(plugins)); - t.true(isObject(rules)); + assert.ok(Array.isArray(plugins)); + assert.ok(isObject(rules)); });