test: update power/notification specs to expect (#13497)
* spec: update power/process specs to expect * Address comments
This commit is contained in:
parent
586a6f2e6d
commit
dac435b411
3 changed files with 71 additions and 62 deletions
|
@ -1,13 +1,17 @@
|
|||
const {powerSaveBlocker} = require('electron').remote
|
||||
const assert = require('assert')
|
||||
const chai = require('chai')
|
||||
const dirtyChai = require('dirty-chai')
|
||||
|
||||
const {expect} = chai
|
||||
chai.use(dirtyChai)
|
||||
|
||||
describe('powerSaveBlocker module', () => {
|
||||
it('can be started and stopped', () => {
|
||||
assert.equal(powerSaveBlocker.isStarted(-1), false)
|
||||
expect(powerSaveBlocker.isStarted(-1)).to.be.false()
|
||||
const id = powerSaveBlocker.start('prevent-app-suspension')
|
||||
assert.ok(id != null)
|
||||
assert.equal(powerSaveBlocker.isStarted(id), true)
|
||||
expect(id).to.to.be.a('number')
|
||||
expect(powerSaveBlocker.isStarted(id)).to.be.true()
|
||||
powerSaveBlocker.stop(id)
|
||||
assert.equal(powerSaveBlocker.isStarted(id), false)
|
||||
expect(powerSaveBlocker.isStarted(id)).to.be.false()
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue