2016-01-25 16:03:12 -08:00
|
|
|
/* jslint node:true */
|
|
|
|
|
/* global it:false */
|
|
|
|
|
/* global describe:false */
|
|
|
|
|
/* global before:false */
|
|
|
|
|
/* global after:false */
|
|
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
var async = require('async'),
|
|
|
|
|
database = require('../database.js'),
|
2019-11-21 12:58:06 -08:00
|
|
|
expect = require('expect.js'),
|
|
|
|
|
system = require('../system.js');
|
2016-01-25 16:03:12 -08:00
|
|
|
|
|
|
|
|
function setup(done) {
|
|
|
|
|
async.series([
|
2017-11-27 11:48:36 -08:00
|
|
|
database.initialize,
|
|
|
|
|
database._clear
|
2016-01-25 16:03:12 -08:00
|
|
|
], done);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function cleanup(done) {
|
2017-11-27 11:48:36 -08:00
|
|
|
async.series([
|
|
|
|
|
database._clear,
|
|
|
|
|
database.uninitialize
|
|
|
|
|
], done);
|
2016-01-25 16:03:12 -08:00
|
|
|
}
|
|
|
|
|
|
2019-11-21 12:58:06 -08:00
|
|
|
describe('System', function () {
|
2016-01-25 16:03:12 -08:00
|
|
|
before(setup);
|
|
|
|
|
after(cleanup);
|
|
|
|
|
|
2019-08-19 13:50:44 -07:00
|
|
|
it('can get disks', function (done) {
|
2019-11-21 12:58:06 -08:00
|
|
|
system.getDisks(function (error, disks) {
|
2019-08-19 13:50:44 -07:00
|
|
|
expect(!error).to.be.ok();
|
|
|
|
|
expect(disks).to.be.ok();
|
|
|
|
|
done();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2016-01-25 16:03:12 -08:00
|
|
|
it('can check for disk space', function (done) {
|
2019-11-21 12:58:06 -08:00
|
|
|
system.checkDiskSpace(function (error) {
|
2016-01-25 16:03:12 -08:00
|
|
|
expect(!error).to.be.ok();
|
|
|
|
|
done();
|
|
|
|
|
});
|
|
|
|
|
});
|
2019-11-21 12:58:06 -08:00
|
|
|
|
|
|
|
|
it('can get memory', function (done) {
|
|
|
|
|
system.getMemory(function (error, memory) {
|
|
|
|
|
expect(!error).to.be.ok();
|
2020-06-15 16:06:54 +02:00
|
|
|
|
|
|
|
|
expect(memory.memory).to.be.a('number');
|
|
|
|
|
expect(memory.swap).to.be.a('number');
|
|
|
|
|
|
2019-11-21 12:58:06 -08:00
|
|
|
done();
|
|
|
|
|
});
|
|
|
|
|
});
|
2016-01-25 16:03:12 -08:00
|
|
|
});
|
|
|
|
|
|