Fix log test

This commit is contained in:
Girish Ramakrishnan
2022-11-06 16:02:46 +01:00
parent 440504a6e9
commit 925b08c7a1
4 changed files with 10 additions and 3 deletions
+7
View File
@@ -8,6 +8,7 @@
const constants = require('../../constants.js'),
common = require('./common.js'),
expect = require('expect.js'),
fs = require('fs'),
http = require('http'),
os = require('os'),
paths = require('../../paths.js'),
@@ -300,6 +301,11 @@ describe('Cloudron API', function () {
});
describe('logs', function () {
before(function () {
console.log(paths.BOX_LOG_FILE);
fs.writeFileSync(paths.BOX_LOG_FILE, '2022-11-06T15:06:20.009Z box:apphealthmonitor app health: 0 alive / 0 dead.\n', 'utf8');
});
it('logStream - requires event-stream accept header', async function () {
const response = await superagent.get(`${serverUrl}/api/v1/cloudron/logstream/box`)
.query({ access_token: owner.token, fromLine: 0 })
@@ -335,6 +341,7 @@ describe('Cloudron API', function () {
expect(dataMessageFound).to.be.ok();
res.destroy();
req.destroy();
done();
}, 1000);