test: update power/notification specs to expect (#13497)

* spec: update power/process specs to expect

* Address comments
This commit is contained in:
Shelley Vohr 2018-08-31 13:52:32 -07:00 committed by Samuel Attard
parent 586a6f2e6d
commit dac435b411
3 changed files with 71 additions and 62 deletions

View file

@ -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()
})
})