Skip to content

Commit 8dbc3d6

Browse files
committed
try to fix tests on windowst
1 parent f6d23ce commit 8dbc3d6

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

test/missing.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ import * as missingModule from '../src/missing.js'
88

99
describe('missing (fetch-only mock)', () => {
1010
let origFetch
11+
let origExit
1112
beforeEach(() => {
1213
origFetch = global.fetch
14+
origExit = process.exit
15+
process.exit = (code) => { throw new Error(`process.exit called with ${code}`) }
1316
})
1417
afterEach(() => {
1518
global.fetch = origFetch
19+
process.exit = origExit
1620
})
1721

1822
it('default export runs without error (minimal happy path)', async () => {

test/parseLocalLanguage.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('parseLocalLanguage (temp dir)', () => {
3232
expect(result.length).toBe(1)
3333
expect(result[0].language).toBe('en')
3434
expect(result[0].namespace).toBe('common')
35-
expect(result[0].path).toContain('common.json')
35+
expect(result[0].path).toContain(path.join('en', 'common.json'))
3636
expect(result[0].content).toEqual({ hello: 'world' })
3737
})
3838
})

test/parseLocalLanguages.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ describe('parseLocalLanguages (temp dir)', () => {
3535
const en = result.find(r => r.language === 'en')
3636
const de = result.find(r => r.language === 'de')
3737
expect(en.namespace).toBe('common')
38-
expect(en.path).toContain('en/common.json')
38+
expect(en.path).toContain(path.join('en', 'common.json'))
3939
expect(en.content).toEqual({ hello: 'world' })
4040
expect(de.namespace).toBe('common')
41-
expect(de.path).toContain('de/common.json')
41+
expect(de.path).toContain(path.join('de', 'common.json'))
4242
expect(de.content).toEqual({ hallo: 'welt' })
4343
})
4444
})

test/parseLocalReference.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('parseLocalReference (temp dir)', () => {
3232
expect(result.length).toBe(1)
3333
expect(result[0].language).toBe('en')
3434
expect(result[0].namespace).toBe('common')
35-
expect(result[0].path).toContain('common.json')
35+
expect(result[0].path).toContain(path.join('en', 'common.json'))
3636
expect(result[0].content).toEqual({ hello: 'world' })
3737
})
3838
})

0 commit comments

Comments
 (0)