Skip to content

Commit 2cf6670

Browse files
committed
test: set env before important to allow import-time conditional code paths
1 parent 68cef57 commit 2cf6670

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/utils/lambda-helpers.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ export async function loadAndInvokeFunctionImpl(
115115
ctx,
116116
{ headers, httpMethod, flags, url, env } = {},
117117
) {
118+
const restoreEnvironment = temporarilySetEnv(ctx, env)
119+
118120
const { handler } = await import(
119121
'file:///' + join(ctx.functionDist, SERVER_HANDLER_NAME, '___netlify-entry-point.mjs')
120122
)
121123

122-
const restoreEnvironment = temporarilySetEnv(ctx, env)
123-
124124
let resolveInvocation, rejectInvocation
125125
const invocationPromise = new Promise((resolve, reject) => {
126126
resolveInvocation = resolve

0 commit comments

Comments
 (0)