Skip to content

Commit 6067a48

Browse files
committed
temporary for windows tests
1 parent d063d8e commit 6067a48

4 files changed

Lines changed: 18 additions & 3 deletions

File tree

test/missing.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ describe('missing (fetch-only mock)', () => {
4444
pathMaskInterpolationPrefix: '{{',
4545
pathMaskInterpolationSuffix: '}}'
4646
}
47+
// Debug: check file existence and add a short delay
48+
const filePath = path.join(enDir, 'common.json')
49+
console.log('File exists before CLI:', fs.existsSync(filePath), filePath)
50+
await new Promise((resolve) => setTimeout(resolve, 20))
4751
await expect(missing(opt)).resolves.toBeUndefined()
4852
fs.rmSync(tempDir, { recursive: true, force: true })
4953
})

test/parseLocalLanguage.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('parseLocalLanguage (temp dir)', () => {
1313
const lngDir = path.join(tempDir, 'en')
1414
fs.mkdirSync(lngDir)
1515
fs.writeFileSync(path.join(lngDir, 'common.json'), JSON.stringify({ hello: 'world' }))
16-
// Debug: print directory structure
16+
// Debug: print directory structure and file existence
1717
function printDir (dir, prefix = '') {
1818
const files = fs.readdirSync(dir)
1919
for (const file of files) {
@@ -27,6 +27,9 @@ describe('parseLocalLanguage (temp dir)', () => {
2727
}
2828
}
2929
printDir(tempDir)
30+
const filePath = path.join(lngDir, 'common.json')
31+
console.log('File exists before test:', fs.existsSync(filePath), filePath)
32+
await new Promise((resolve) => setTimeout(resolve, 20))
3033
const mod = await import('../src/parseLocalLanguage.js')
3134
parseLocalLanguage = mod.default
3235
})

test/parseLocalLanguages.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('parseLocalLanguages (temp dir)', () => {
1717
fs.mkdirSync(deDir)
1818
fs.writeFileSync(path.join(enDir, 'common.json'), JSON.stringify({ hello: 'world' }))
1919
fs.writeFileSync(path.join(deDir, 'common.json'), JSON.stringify({ hallo: 'welt' }))
20-
// Debug: print directory structure
20+
// Debug: print directory structure and file existence
2121
function printDir (dir, prefix = '') {
2222
const files = fs.readdirSync(dir)
2323
for (const file of files) {
@@ -31,6 +31,11 @@ describe('parseLocalLanguages (temp dir)', () => {
3131
}
3232
}
3333
printDir(tempDir)
34+
const enFilePath = path.join(tempDir, 'en', 'common.json')
35+
const deFilePath = path.join(tempDir, 'de', 'common.json')
36+
console.log('File exists before test (en):', fs.existsSync(enFilePath), enFilePath)
37+
console.log('File exists before test (de):', fs.existsSync(deFilePath), deFilePath)
38+
return new Promise((resolve) => setTimeout(resolve, 20))
3439
})
3540
afterEach(() => {
3641
fs.rmSync(tempDir, { recursive: true, force: true })

test/parseLocalReference.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('parseLocalReference (temp dir)', () => {
1414
const lngDir = path.join(tempDir, 'en')
1515
fs.mkdirSync(lngDir)
1616
fs.writeFileSync(path.join(lngDir, 'common.json'), JSON.stringify({ hello: 'world' }))
17-
// Debug: print directory structure
17+
// Debug: print directory structure and file existence
1818
function printDir (dir, prefix = '') {
1919
const files = fs.readdirSync(dir)
2020
for (const file of files) {
@@ -28,6 +28,9 @@ describe('parseLocalReference (temp dir)', () => {
2828
}
2929
}
3030
printDir(tempDir)
31+
const filePath = path.join(lngDir, 'common.json')
32+
console.log('File exists before test:', fs.existsSync(filePath), filePath)
33+
return new Promise((resolve) => setTimeout(resolve, 20))
3134
})
3235
afterEach(() => {
3336
fs.rmSync(tempDir, { recursive: true, force: true })

0 commit comments

Comments
 (0)