mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Update helpers.expandTildePath to handle receiving an os object without homedir, address minor @ts-check confusion in same file.
This commit is contained in:
parent
95466e29be
commit
5b0588f378
3 changed files with 6 additions and 5 deletions
|
|
@ -471,7 +471,7 @@ test("applyFix", (t) => {
|
|||
const [ line, fixInfo, lineEnding, expected ] = testCase;
|
||||
// @ts-ignore
|
||||
const actual = helpers.applyFix(line, fixInfo, lineEnding);
|
||||
t.is(actual, expected, "Incorrect fix applied.");
|
||||
t.is(actual, String(expected), "Incorrect fix applied.");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -949,7 +949,7 @@ test("applyFixes", (t) => {
|
|||
const [ input, errors, expected ] = testCase;
|
||||
// @ts-ignore
|
||||
const actual = helpers.applyFixes(input, errors);
|
||||
t.is(actual, expected, "Incorrect fix applied.");
|
||||
t.is(actual, String(expected), "Incorrect fix applied.");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -1277,9 +1277,10 @@ test("htmlElementRanges", (t) => {
|
|||
});
|
||||
|
||||
test("expandTildePath", (t) => {
|
||||
t.plan(16);
|
||||
t.plan(17);
|
||||
const homedir = os.homedir();
|
||||
t.is(helpers.expandTildePath("", os), "");
|
||||
t.is(helpers.expandTildePath("", {}), "");
|
||||
t.is(helpers.expandTildePath("", null), "");
|
||||
t.is(
|
||||
path.resolve(helpers.expandTildePath("~", os)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue