Skip to content

Commit f8c1000

Browse files
committed
test: fix test
1 parent a4484d1 commit f8c1000

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

test/fixer-test.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,31 @@
33
import assert from "assert";
44
import preset from "../src/index";
55
import { TextLintCore } from "textlint";
6+
import path from "path";
67
import fs from "fs";
78

89
describe("fixer-test", function () {
910
it("should convert expected", function () {
10-
const expected = fs.readFileSync(__dirname + "/fixtures/output.md", "utf-8");
11+
const expected = fs.readFileSync(path.join(__dirname, "/fixtures/output.md"), "utf-8");
1112
const textlint = new TextLintCore();
1213
// all true
1314
textlint.setupRules(preset.rules);
14-
return textlint.fixFile(__dirname + "/fixtures/input.md").then((result) => {
15+
return textlint.fixFile(path.join(__dirname, "/fixtures/input.md")).then((result) => {
1516
assert.equal(result.remainingMessages.length, 0);
1617
const inputs = result.output.split("\n");
1718
const outputs = expected.split("\n");
1819
for (var i = 0; i < inputs.length; i++) {
1920
const input = inputs[i];
2021
const output = outputs[i];
21-
assert.strictEqual(input, output);
22+
assert.strictEqual(
23+
input,
24+
output,
25+
`mismatch at line ${i}
26+
27+
at ${path.join(__dirname, "/fixtures/input.md")}:${i}
28+
at ${path.join(__dirname, "/fixtures/output.md")}:${i}
29+
`
30+
);
2231
}
2332
});
2433
});

0 commit comments

Comments
 (0)