From 7f509a109a638860607d0dd88a9de0888c712328 Mon Sep 17 00:00:00 2001 From: Santiago Bosio Date: Tue, 11 Jun 2024 16:31:06 -0300 Subject: [PATCH] Fixing expected test outputs on CI runs again --- test/api-client.test.ts | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/test/api-client.test.ts b/test/api-client.test.ts index 165cb9c..c0ea484 100644 --- a/test/api-client.test.ts +++ b/test/api-client.test.ts @@ -192,10 +192,9 @@ describe('api_client', () => { const cmd = new Command([], ctx.config) await cmd.heroku.get('/account') - expect(stderr.output).to.include('This account is delinquent with payment and we‘ll suspend it on') - expect(stderr.output).to.include(`${suspensionTime}`) - expect(stderr.output).to.include('This account is delinquent with payment and we‘ll delete it on') - expect(stderr.output).to.include(`${deletionTime}`) + const stderrOutput = stderr.output.replace('› ', '').replace('\n', ' ') + expect(stderrOutput).to.include(`This account is delinquent with payment and we‘ll suspend it on ${suspensionTime}`) + expect(stderrOutput).to.include(`This account is delinquent with payment and we‘ll delete it on ${deletionTime}`) stderr.stop() particleboard.done() }) @@ -222,10 +221,10 @@ describe('api_client', () => { stderr.start() const cmd = new Command([], ctx.config) await cmd.heroku.get('/account') - expect(stderr.output).to.include('This account is delinquent with payment and we‘ll suspend it on') - expect(stderr.output).to.include(`${suspensionTime}`) - expect(stderr.output).to.include('This account is delinquent with payment and we‘ll delete it on') - expect(stderr.output).to.include(`${deletionTime}`) + + const stderrOutput = stderr.output.replace('› ', '').replace('\n', ' ') + expect(stderrOutput).to.include(`This account is delinquent with payment and we‘ll suspend it on ${suspensionTime}`) + expect(stderrOutput).to.include(`This account is delinquent with payment and we‘ll delete it on ${deletionTime}`) stderr.stop() stderr.start() @@ -320,10 +319,9 @@ describe('api_client', () => { const cmd = new Command([], ctx.config) await cmd.heroku.get('/teams/my_team/members') - expect(stderr.output).to.include('This team is delinquent with payment and we‘ll suspend it on') - expect(stderr.output).to.include(`${suspensionTime}`) - expect(stderr.output).to.include('This team is delinquent with payment and we‘ll delete it on') - expect(stderr.output).to.include(`${deletionTime}`) + const stderrOutput = stderr.output.replace('› ', '').replace('\n', ' ') + expect(stderrOutput).to.include(`This team is delinquent with payment and we‘ll suspend it on ${suspensionTime}`) + expect(stderrOutput).to.include(`This team is delinquent with payment and we‘ll delete it on ${deletionTime}`) stderr.stop() particleboard.done() }) @@ -350,14 +348,15 @@ describe('api_client', () => { stderr.start() const cmd = new Command([], ctx.config) await cmd.heroku.get('/teams/my_team/members') - expect(stderr.output).to.include('This team is delinquent with payment and we‘ll suspend it on') - expect(stderr.output).to.include(`${suspensionTime}`) - expect(stderr.output).to.include('This team is delinquent with payment and we‘ll delete it on') - expect(stderr.output).to.include(`${deletionTime}`) + + const stderrOutput = stderr.output.replace('› ', '').replace('\n', ' ') + expect(stderrOutput).to.include(`This team is delinquent with payment and we‘ll suspend it on ${suspensionTime}`) + expect(stderrOutput).to.include(`This team is delinquent with payment and we‘ll delete it on ${deletionTime}`) stderr.stop() stderr.start() await cmd.heroku.get('/teams/my_team/members') + expect(stderr.output).to.eq('') expect(stderr.output).to.eq('') stderr.stop()