-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1938: Release next v14.x r=ZauberNerd a=hops-release-bot[bot] # Next v14.x release Co-authored-by: Robert Kowalski <[email protected]> Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Co-authored-by: Björn Brauer <[email protected]> Co-authored-by: Robert Kowalski <[email protected]> Co-authored-by: Hops release bot <77399080+hops-release-bot[bot]@users.noreply.github.com>
- Loading branch information
Showing
75 changed files
with
1,602 additions
and
1,273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/* eslint-env node, jest */ | ||
// eslint-disable-next-line node/no-missing-require | ||
const { environmentalize } = require('..').internal; | ||
|
||
test('Should allow env-vars in the configuration which are resolved', () => { | ||
global._env = { | ||
FOOBAR: 'TEST', | ||
}; | ||
|
||
const res = environmentalize( | ||
{ | ||
foo: { | ||
bar: '[FOOBAR]', | ||
baz: '[SECOND]', | ||
}, | ||
}, | ||
{ 'foo.bar': true } | ||
); | ||
|
||
delete global._env; | ||
expect(res._env.FOOBAR).toBe('TEST'); | ||
expect(res._env.SECOND).toBe(undefined); | ||
}); | ||
|
||
test('Should allow Object whitelisting', () => { | ||
global._env = { | ||
FOOBAR: 'TEST', | ||
SECOND: 'BANANA', | ||
}; | ||
|
||
const res = environmentalize( | ||
{ | ||
foo: { | ||
bar: '[FOOBAR]', | ||
baz: '[SECOND]', | ||
}, | ||
}, | ||
{ foo: true } | ||
); | ||
|
||
delete global._env; | ||
expect(res._env.FOOBAR).toBe('TEST'); | ||
expect(res._env.SECOND).toBe('BANANA'); | ||
}); | ||
|
||
test('Should handle Arrays', () => { | ||
global._env = { | ||
FOOBAR: 'TEST', | ||
SECOND: 'PINEAPPLE', | ||
}; | ||
|
||
const res = environmentalize( | ||
{ | ||
foo: [ | ||
{ | ||
bar: '[FOOBAR]', | ||
baz: '[SECOND]', | ||
}, | ||
], | ||
}, | ||
{ foo: true } | ||
); | ||
|
||
delete global._env; | ||
expect(res._env.FOOBAR).toBe('TEST'); | ||
expect(res._env.SECOND).toBe('PINEAPPLE'); | ||
}); | ||
|
||
test('Should support fallbacks', () => { | ||
global._env = {}; | ||
|
||
const res = environmentalize( | ||
{ | ||
foo: { | ||
bar: '[FOOBAR=apple]', | ||
}, | ||
}, | ||
{ 'foo.bar': true } | ||
); | ||
|
||
delete global._env; | ||
expect(res._env.FOOBAR).toBe('apple'); | ||
expect(res._env.SECOND).toBe(undefined); | ||
}); | ||
|
||
test('Should ignore other props', () => { | ||
global._env = { | ||
FOOBAR: 'onion', | ||
SECOND: 'cheese', | ||
}; | ||
|
||
const res = environmentalize( | ||
{ | ||
foo: { | ||
bar: '[FOOBAR]', | ||
}, | ||
}, | ||
{ 'foo.bar': true } | ||
); | ||
|
||
delete global._env; | ||
expect(res._env.FOOBAR).toBe('onion'); | ||
expect(res._env.SECOND).toBe(undefined); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.