diff --git a/test/private-key.js b/test/private-key.js index 0154f533..9c7b1460 100644 --- a/test/private-key.js +++ b/test/private-key.js @@ -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;