electron/spec/api-process-spec.js
Hari Krishna Reddy Juturu 07d8dfaa53 Fixing UT
2017-05-04 14:50:06 -07:00

26 lines
1,002 B
JavaScript

const assert = require('assert')
describe('process module', function () {
describe('process.getCPUUsage()', function () {
it('returns a cpu usage object', function () {
const cpuUsage = process.getCPUUsage()
assert.equal(typeof cpuUsage.percentCPUUsage, 'number')
assert.equal(typeof cpuUsage.idleWakeupsPerSecond, 'number')
})
})
describe('process.getIOCounters()', function () {
it('returns an io counters object', function () {
if (process.platform === 'darwin') {
return
}
const ioCounters = process.getIOCounters()
assert.equal(typeof ioCounters.readOperationCount, 'number')
assert.equal(typeof ioCounters.writeOperationCount, 'number')
assert.equal(typeof ioCounters.otherOperationCount, 'number')
assert.equal(typeof ioCounters.readTransferCount, 'number')
assert.equal(typeof ioCounters.writeTransferCount, 'number')
assert.equal(typeof ioCounters.otherTransferCount, 'number')
})
})
})