Fix log test
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user