Skip to content

Commit

Permalink
Add Windows-style paths test
Browse files Browse the repository at this point in the history
  • Loading branch information
aaharu committed Jul 13, 2021
1 parent 644739a commit 13fea6b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/lint-files.js
Expand Up @@ -51,6 +51,19 @@ test('ignores dirs for empty extensions', async t => {
t.is(actual, expected);
t.is(results.errorCount, 1);
}

{
const cwd = path.join(__dirname, 'fixtures/nodir');
// Check Windows-style paths are working
const glob = 'nested\\*';
const results = await xo.lintFiles(glob, {cwd});
const {results: [fileResult]} = results;

const expected = 'fixtures/nodir/nested/index.js'.split('/').join(path.sep);
const actual = path.relative(__dirname, fileResult.filePath);
t.is(actual, expected);
t.is(results.errorCount, 1);
}
});

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

0 comments on commit 13fea6b

Please sign in to comment.