Skip to content

Commit

Permalink
chore: update test config
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari committed Nov 26, 2023
1 parent b9b4846 commit 0486ab9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/ruff_fmt/test_deno/deno.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ for await (const entry of walk(test_root, {
const expect_path = entry.path.replace(/input$/, "expect");
const input = Deno.readTextFileSync(entry.path);

const actual = format(input);

if (update) {
const actual = format(input);
Deno.writeTextFileSync(expect_path, actual);
} else {
const expected = Deno.readTextFileSync(expect_path);

const test_name = relative(test_root.pathname, entry.path);

Deno.test(test_name, () => {
const actual = format(input);
assertEquals(actual, expected);
});
}
Expand Down
4 changes: 2 additions & 2 deletions crates/ruff_fmt/test_node/test-node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ for await (const dirent of await fs.opendir(test_root, { recursive: true })) {
continue;
}

const input_path = dirent.path;
const input_path = path.join(dirent.path, dirent.name);
const ext = path.extname(input_path);

switch (ext) {
Expand All @@ -31,11 +31,11 @@ for await (const dirent of await fs.opendir(test_root, { recursive: true })) {
fs.readFile(input_path, "utf-8"),
fs.readFile(expect_path, "utf-8"),
]);
const actual = format(input);

const test_name = path.relative(test_root, input_path);

test(test_name, () => {
const actual = format(input);
assert.equal(actual, expected);
});
}

0 comments on commit 0486ab9

Please sign in to comment.