forked from adamlaska/electron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-process-spec.js
More file actions
29 lines (26 loc) · 1010 Bytes
/
api-process-spec.js
File metadata and controls
29 lines (26 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const assert = require('assert')
describe('process module', () => {
describe('process.getCPUUsage()', () => {
it('returns a cpu usage object', () => {
const cpuUsage = process.getCPUUsage()
assert.equal(typeof cpuUsage.percentCPUUsage, 'number')
assert.equal(typeof cpuUsage.idleWakeupsPerSecond, 'number')
})
})
describe('process.getIOCounters()', () => {
before(function () {
if (process.platform === 'darwin') {
this.skip()
}
})
it('returns an io counters object', () => {
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')
})
})
})