diff --git a/lib/plugins/aws/invoke/index.test.js b/lib/plugins/aws/invoke/index.test.js index 915911695..1d31aa963 100644 --- a/lib/plugins/aws/invoke/index.test.js +++ b/lib/plugins/aws/invoke/index.test.js @@ -51,6 +51,7 @@ describe('AwsInvoke', () => { }); describe('#extendedValidate()', () => { + let backupIsTTY; beforeEach(() => { serverless.config.servicePath = true; serverless.service.environment = { @@ -73,6 +74,15 @@ describe('AwsInvoke', () => { }; awsInvoke.options.data = null; awsInvoke.options.path = false; + + // Ensure there's no attempt to read path from stdin + backupIsTTY = process.stdin.isTTY; + process.stdin.isTTY = true; + }); + + afterEach(() => { + if (backupIsTTY) process.stdin.isTTY = backupIsTTY; + delete process.stdin.isTTY; }); it('it should throw error if function is not provided', () => {