Migrate from Ava test framework to node:test
This commit is contained in:
1 parent
0c9c027a77
commit
ddb240d542
12 files changed
+146
-4572
No files matched your search
+7
-3
@@ -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),
|
||||
);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user