Skip to content

Commit cdfd0d8

Browse files
NamesMTdaniel-lxs
authored andcommitted
chore: better log format
1 parent 88f3c19 commit cdfd0d8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/utils/__tests__/config.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe("injectEnv", () => {
5353
const result = await injectEnv(configString, "NOT_FOUND")
5454
expect(result).toBe(expectedString)
5555
expect(consoleWarnSpy).toHaveBeenCalledWith(
56-
"[injectVariables] variable MISSING_VAR referenced but not found in env",
56+
`[injectVariables] variable "MISSING_VAR" referenced but not found in "env"`,
5757
)
5858
consoleWarnSpy.mockRestore()
5959
})
@@ -65,7 +65,7 @@ describe("injectEnv", () => {
6565
const result = await injectEnv(configString)
6666
expect(result).toBe(expectedString)
6767
expect(consoleWarnSpy).toHaveBeenCalledWith(
68-
"[injectVariables] variable ANOTHER_MISSING referenced but not found in env",
68+
`[injectVariables] variable "ANOTHER_MISSING" referenced but not found in "env"`,
6969
)
7070
consoleWarnSpy.mockRestore()
7171
})

src/utils/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export async function injectVariables<C extends string | Record<PropertyKey, any
3737
else
3838
_config = _config.replace(new RegExp(`\\$\\{${key}:([\\w]+)\\}`, "g"), (match, name) => {
3939
if (value[name] == null)
40-
console.warn(`[injectVariables] variable ${name} referenced but not found in ${key}`)
40+
console.warn(`[injectVariables] variable "${name}" referenced but not found in "${key}"`)
4141

4242
return value[name] ?? propNotFoundValue ?? match
4343
})

0 commit comments

Comments
 (0)