forked from mirrors/probot
test: allow to set PRIVATE_KEY with "\\n" characters
This commit is contained in:
parent
2074e440d4
commit
04b448b7ee
|
@ -48,6 +48,21 @@ describe('private-key', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('when a PRIVATE_KEY has line breaks', function () {
|
||||
beforeEach(function () {
|
||||
process.env.PRIVATE_KEY = 'line 1\\nline 2';
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
delete process.env.PRIVATE_KEY;
|
||||
});
|
||||
|
||||
it('should return the key', function () {
|
||||
expect(findPrivateKey())
|
||||
.toEqual('line 1\nline 2');
|
||||
});
|
||||
});
|
||||
|
||||
describe('when a PRIVATE_KEY_PATH env var is provided', function () {
|
||||
beforeEach(function () {
|
||||
process.env.PRIVATE_KEY_PATH = keyfilePath;
|
||||
|
|
Loading…
Reference in New Issue