37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
|
|
/* jslint node:true */
|
||
|
|
/* global it:false */
|
||
|
|
/* global describe:false */
|
||
|
|
/* global before:false */
|
||
|
|
/* global after:false */
|
||
|
|
|
||
|
|
'use strict';
|
||
|
|
|
||
|
|
const common = require('./common.js'),
|
||
|
|
df = require('../df.js'),
|
||
|
|
expect = require('expect.js');
|
||
|
|
|
||
|
|
describe('System', function () {
|
||
|
|
const { setup, cleanup } = common;
|
||
|
|
|
||
|
|
before(setup);
|
||
|
|
after(cleanup);
|
||
|
|
|
||
|
|
it('can get disks', async function () {
|
||
|
|
// does not work on archlinux 8!
|
||
|
|
if (require('child_process').execSync('uname -a').toString().indexOf('-arch') !== -1) return;
|
||
|
|
|
||
|
|
const disks = await df.disks();
|
||
|
|
expect(disks).to.be.ok();
|
||
|
|
expect(disks.some(d => d.mountpoint === '/')).to.be.ok();
|
||
|
|
});
|
||
|
|
|
||
|
|
it('can get file', async function () {
|
||
|
|
// does not work on archlinux 8!
|
||
|
|
if (require('child_process').execSync('uname -a').toString().indexOf('-arch') !== -1) return;
|
||
|
|
|
||
|
|
const disks = await df.file(__dirname);
|
||
|
|
expect(disks).to.be.ok();
|
||
|
|
expect(disks.mountpoint).to.be('/home');
|
||
|
|
});
|
||
|
|
});
|