Migrate from Ava test framework to node:test

This commit is contained in:
Zaid Humaimidi committed 2023-12-17 22:26:52 -08:00
1 parent 0c9c027a77
commit ddb240d542
12 files changed
+146 -4572

No files matched your search

+7 -3
View File
@@ -1,14 +1,18 @@
import ava from "ava";
import test from "node:test";
import assert from "node:assert";
import * as yaml from "yaml";
import { stringify } from "../lib/common/yaml";
import testCases from "./yaml-tests.json";
ava("stringify", (t) => {
void test("stringify", () => {
for (const testCase of testCases) {
let str = stringify(testCase);
if (str.startsWith(">2")) str = ">3" + str.slice(2);
if (str.startsWith("|2")) str = "|3" + str.slice(2);
t.deepEqual(yaml.parse(yaml.stringify(testCase)), yaml.parse(str));
assert.deepStrictEqual(
yaml.parse(yaml.stringify(testCase)),
yaml.parse(str),
);
}
});