Skip to content

Commit 9478e8e

Browse files
committedMar 12, 2020
Add test for previous commit for absolute path handling by node-ignore.
1 parent 6e9849c commit 9478e8e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
 

‎test/test.js

+18
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,24 @@ test('.markdownlintignore is applied correctly', async t => {
646646
}
647647
});
648648

649+
test('.markdownlintignore works with semi-absolute paths', async t => {
650+
try {
651+
await execa(
652+
path.resolve('..', 'markdownlint.js'), ['./incorrect.md'], {
653+
cwd: path.join(__dirname, 'markdownlintignore'),
654+
stripFinalNewline: false
655+
});
656+
t.fail();
657+
} catch (error) {
658+
const expected = [
659+
'./incorrect.md:1:8 MD047/single-trailing-newline Files should end with a single newline character',
660+
''
661+
].join('\n');
662+
t.deepEqual(error.stdout, '');
663+
t.deepEqual(error.stderr, expected);
664+
}
665+
});
666+
649667
test('--ignore-path works with .markdownlintignore', async t => {
650668
try {
651669
await execa(

0 commit comments

Comments
 (0)
Please sign in to comment.