From 13fea6bca724bf392b9d5919b1de772009de9951 Mon Sep 17 00:00:00 2001 From: Haruaki OTAKE Date: Wed, 14 Jul 2021 04:34:03 +0900 Subject: [PATCH] Add Windows-style paths test --- test/lint-files.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/lint-files.js b/test/lint-files.js index 2ba150cd..3fcd84cd 100644 --- a/test/lint-files.js +++ b/test/lint-files.js @@ -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 => {