Skip to content

Commit f4d860e

Browse files
committed
Add Windows-style paths test
1 parent 845266d commit f4d860e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/lint-files.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ test('ignores dirs for empty extensions', async t => {
5151
t.is(actual, expected);
5252
t.is(results.errorCount, 1);
5353
}
54+
55+
{
56+
const cwd = path.join(__dirname, 'fixtures/nodir');
57+
// Check Windows-style paths are working
58+
const glob = 'nested\\*';
59+
const results = await xo.lintFiles(glob, {cwd});
60+
const {results: [fileResult]} = results;
61+
62+
const expected = 'fixtures/nodir/nested/index.js'.split('/').join(path.sep);
63+
const actual = path.relative(__dirname, fileResult.filePath);
64+
t.is(actual, expected);
65+
t.is(results.errorCount, 1);
66+
}
5467
});
5568

5669
test.serial('cwd option', async t => {

0 commit comments

Comments
 (0)