test: allow to set PRIVATE_KEY with "\\n" characters

This commit is contained in:
Gregor 2017-07-13 08:07:53 -07:00
parent 2074e440d4
commit 04b448b7ee
1 changed files with 15 additions and 0 deletions

View File

@ -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;