test: fix windows path isolation (#659)

This commit is contained in:
luSkyl
2026-05-12 20:56:04 +08:00
committed by GitHub
parent 8b57c4a278
commit 8b291d7a48
3 changed files with 20 additions and 5 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ function walkFiles(dir: string, files: string[] = []): string[] {
const path = join(dir, entry.name)
if (entry.isDirectory()) {
walkFiles(path, files)
} else if (/\.(ts|vue)$/.test(entry.name) && !path.includes('/i18n/locales/')) {
} else if (/\.(ts|vue)$/.test(entry.name) && !path.replace(/\\/g, '/').includes('/i18n/locales/')) {
files.push(path)
}
}
@@ -76,6 +76,6 @@ describe('i18n locale coverage', () => {
})
it('keeps the coverage scanner rooted in client source files', () => {
expect(relative(process.cwd(), SOURCE_ROOT)).toBe('packages/client/src')
expect(relative(process.cwd(), SOURCE_ROOT)).toBe(join('packages', 'client', 'src'))
})
})