Skip to content

Commit

Permalink
Convert loadEnvFiles test to typescript and fix TS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Philzen committed Jan 7, 2025
1 parent 9af0d39 commit 926b6c6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {
loadDefaultEnvFiles,
loadNodeEnvDerivedEnvFile,
loadUserSpecifiedEnvFiles,
} from '../lib/loadEnvFiles'
} from '../loadEnvFiles.js'

describe('loadEnvFiles', () => {
let originalProcessEnv
let originalProcessEnv: NodeJS.Process['env']
beforeAll(() => {
originalProcessEnv = { ...process.env }
})
Expand Down Expand Up @@ -133,7 +133,7 @@ describe('loadEnvFiles', () => {
loadUserSpecifiedEnvFiles(cwd, ['missing'])
} catch (error) {
// Just testing that the error message reports the file it tried to load.
expect(error.message).toMatch(/\.env\.missing/)
expect((error as Error).message).toMatch(/\.env\.missing/)
}
})
})

0 comments on commit 926b6c6

Please sign in to comment.