Skip to content

Commit b8f9cd1

Browse files
committed
fix test
1 parent 407c166 commit b8f9cd1

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

packages/cli/test/unit/lib/run/log-displayer.unit.test.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,10 @@ describe('logDisplayer', function () {
3737
public readyState: number = 0 // CONNECTING
3838
public url: string
3939
private errorCode: number
40-
private static instanceCount = 0
4140

4241
constructor(url: string, options?: any) {
4342
this.url = url
44-
MockEventSource.instanceCount++
45-
46-
// Determine error code based on URL or other factors
47-
if (url.includes('telemetry.heroku.com')) {
48-
this.errorCode = 401 // Default for Cedar app tests
49-
} else {
50-
this.errorCode = 401 // Default for Cedar app tests
51-
}
43+
this.errorCode = 401
5244

5345
// Simulate connection attempt
5446
setTimeout(() => {
@@ -345,7 +337,7 @@ describe('logDisplayer', function () {
345337
}).get('/apps/my-fir-app')
346338
.reply(200, firApp)
347339
.post('/apps/my-fir-app/log-sessions')
348-
.reply(500, {message: 'Internal Server Error'})
340+
.reply(500)
349341
})
350342

351343
afterEach(function () {
@@ -364,7 +356,7 @@ describe('logDisplayer', function () {
364356
stdout.stop()
365357
stderr.stop()
366358
const {message} = error as Error
367-
expect(message.trim()).to.equal('Internal Server Error')
359+
expect(message.trim()).to.equal('HTTP Error 500 for POST https://api.heroku.com/apps/my-fir-app/log-sessions')
368360
}
369361

370362
// it displays message about fetching logs for fir apps

0 commit comments

Comments
 (0)