mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Ensure to not wait for stdin when testing
This commit is contained in:
parent
2d99d7f082
commit
8fcfee6168
@ -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', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user