mirror of
https://github.com/shivammathur/setup-php.git
synced 2026-05-16 10:21:45 +07:00
Harden environment lookup
This commit is contained in:
@@ -11,6 +11,12 @@ describe('Utils tests', () => {
|
||||
expect(await utils.readEnv('TEST')).toBe('setup-php');
|
||||
expect(await utils.readEnv('test_hyphen')).toBe('setup-php');
|
||||
expect(await utils.readEnv('TEST_HYPHEN')).toBe('setup-php');
|
||||
expect(await utils.readEnv('test invalid')).toBe('');
|
||||
process.env['conflict_hyphen'] = 'setup-php';
|
||||
process.env['conflict-hyphen'] = 'wrong';
|
||||
expect(await utils.readEnv('conflict_hyphen')).toBe('setup-php');
|
||||
delete process.env['conflict_hyphen'];
|
||||
delete process.env['conflict-hyphen'];
|
||||
expect(await utils.readEnv('undefined')).toBe('');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user