diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 425a976ecc..9d434fa425 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -870,7 +870,9 @@ class FunctionsCustomServerTest extends Scope 'functionId' => 'unique()', 'name' => 'Test '.$name, 'runtime' => $name, - 'vars' => [], + 'vars' => [ + 'CUSTOM_VARIABLE' => 'variable', + ], 'events' => [], 'schedule' => '', 'timeout' => $timeout, @@ -934,6 +936,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']); $this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT_DATA']); $this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']); + $this->assertEquals('variable', $output['CUSTOM_VARIABLE']); $this->assertEquals('', $output['APPWRITE_FUNCTION_USER_ID']); $this->assertEmpty($output['APPWRITE_FUNCTION_JWT']); $this->assertEquals($this->getProject()['$id'], $output['APPWRITE_FUNCTION_PROJECT_ID']); diff --git a/tests/resources/functions/node/index.js b/tests/resources/functions/node/index.js index ea62c50ac7..8dc0fbef39 100644 --- a/tests/resources/functions/node/index.js +++ b/tests/resources/functions/node/index.js @@ -24,5 +24,6 @@ module.exports = async (req, res) => { 'APPWRITE_FUNCTION_USER_ID' : req.env.APPWRITE_FUNCTION_USER_ID, 'APPWRITE_FUNCTION_JWT' : req.env.APPWRITE_FUNCTION_JWT, 'APPWRITE_FUNCTION_PROJECT_ID' : req.env.APPWRITE_FUNCTION_PROJECT_ID, + 'CUSTOM_VARIABLE' : req.env.CUSTOM_VARIABLE }); } \ No newline at end of file