feat: improve functions tests
This commit is contained in:
parent
cc8fac0297
commit
7a6d8502de
2 changed files with 5 additions and 1 deletions
|
@ -870,7 +870,9 @@ class FunctionsCustomServerTest extends Scope
|
||||||
'functionId' => 'unique()',
|
'functionId' => 'unique()',
|
||||||
'name' => 'Test '.$name,
|
'name' => 'Test '.$name,
|
||||||
'runtime' => $name,
|
'runtime' => $name,
|
||||||
'vars' => [],
|
'vars' => [
|
||||||
|
'CUSTOM_VARIABLE' => 'variable',
|
||||||
|
],
|
||||||
'events' => [],
|
'events' => [],
|
||||||
'schedule' => '',
|
'schedule' => '',
|
||||||
'timeout' => $timeout,
|
'timeout' => $timeout,
|
||||||
|
@ -934,6 +936,7 @@ class FunctionsCustomServerTest extends Scope
|
||||||
$this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']);
|
$this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']);
|
||||||
$this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT_DATA']);
|
$this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT_DATA']);
|
||||||
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
|
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
|
||||||
|
$this->assertEquals('variable', $output['CUSTOM_VARIABLE']);
|
||||||
$this->assertEquals('', $output['APPWRITE_FUNCTION_USER_ID']);
|
$this->assertEquals('', $output['APPWRITE_FUNCTION_USER_ID']);
|
||||||
$this->assertEmpty($output['APPWRITE_FUNCTION_JWT']);
|
$this->assertEmpty($output['APPWRITE_FUNCTION_JWT']);
|
||||||
$this->assertEquals($this->getProject()['$id'], $output['APPWRITE_FUNCTION_PROJECT_ID']);
|
$this->assertEquals($this->getProject()['$id'], $output['APPWRITE_FUNCTION_PROJECT_ID']);
|
||||||
|
|
|
@ -24,5 +24,6 @@ module.exports = async (req, res) => {
|
||||||
'APPWRITE_FUNCTION_USER_ID' : req.env.APPWRITE_FUNCTION_USER_ID,
|
'APPWRITE_FUNCTION_USER_ID' : req.env.APPWRITE_FUNCTION_USER_ID,
|
||||||
'APPWRITE_FUNCTION_JWT' : req.env.APPWRITE_FUNCTION_JWT,
|
'APPWRITE_FUNCTION_JWT' : req.env.APPWRITE_FUNCTION_JWT,
|
||||||
'APPWRITE_FUNCTION_PROJECT_ID' : req.env.APPWRITE_FUNCTION_PROJECT_ID,
|
'APPWRITE_FUNCTION_PROJECT_ID' : req.env.APPWRITE_FUNCTION_PROJECT_ID,
|
||||||
|
'CUSTOM_VARIABLE' : req.env.CUSTOM_VARIABLE
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Reference in a new issue