Skip to content

Commit 3d9fea4

Browse files
committed
chore: fix secret module mock
1 parent 4150b26 commit 3d9fea4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lib/secrets.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// Use dynamic import to support module mock
2-
const fs = await import('node:fs/promises')
3-
41
export const getSecret = async (key: string) => {
52
if (!key) {
63
return ''
@@ -15,6 +12,8 @@ export const getSecret = async (key: string) => {
1512
if (!file) {
1613
return ''
1714
}
15+
// Use dynamic import to support module mock
16+
const fs = await import('node:fs/promises')
1817

1918
return await fs.readFile(file, { encoding: 'utf8' }).catch((e) => {
2019
if (e.code == 'ENOENT') {

0 commit comments

Comments
 (0)