Ensure process is seen as TTY for test run

This commit is contained in:
Mariusz Nowak 2019-09-05 17:39:08 +02:00
parent 008a9e9a47
commit b2ead19255
No known key found for this signature in database
GPG Key ID: B1FBDA8A182B03F2
2 changed files with 18 additions and 0 deletions

View File

@ -15,6 +15,15 @@ describe('interactiveCli: initializeService', () => {
const existingProjectName = 'some-other-service';
const newProjectName = 'foo-bar';
const newProjectPath = join(fixturesPath, newProjectName);
let backupIsTTY;
before(() => {
backupIsTTY = process.stdin.isTTY;
process.stdin.isTTY = true;
});
after(() => {
process.stdin.isTTY = backupIsTTY;
});
afterEach(() => {
if (inquirer.prompt.restore) inquirer.prompt.restore();

View File

@ -31,6 +31,15 @@ describe('interactiveCli: setupAws', () => {
const awsProjectPath = join(fixturesPath, 'some-aws-service');
const accessKeyId = 'AKIAIOSFODNN7EXAMPLE';
const secretAccessKey = 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY';
let backupIsTTY;
before(() => {
backupIsTTY = process.stdin.isTTY;
process.stdin.isTTY = true;
});
after(() => {
process.stdin.isTTY = backupIsTTY;
});
afterEach(() => {
openBrowserUrls.length = 0;