Ensure to test non colored output

This commit is contained in:
Mariusz Nowak 2019-05-31 22:20:01 +02:00
parent 06dafbeba2
commit ce8e24d9df
No known key found for this signature in database
GPG Key ID: B1FBDA8A182B03F2

View File

@ -5,6 +5,7 @@ const fs = require('fs');
const fse = require('fs-extra');
const BbPromise = require('bluebird');
const AWS = require('aws-sdk');
const stripAnsi = require('strip-ansi');
const { expect } = require('chai');
const { execSync } = require('../utils/child-process');
const { getTmpDirPath, replaceTextInFile } = require('../utils/fs');
@ -78,7 +79,7 @@ describe('Service Lifecyle Integration Test', () => {
it('should list existing deployments and roll back to first deployment', () => {
let timestamp;
const listDeploys = execSync(`${serverlessExec} deploy list`);
const output = listDeploys.toString();
const output = stripAnsi(listDeploys.toString());
const match = output.match(new RegExp('Datetime: (.+)'));
if (match) {
timestamp = match[1];