electron/spec/api-power-save-blocker-spec.js
Shelley Vohr dac435b411 test: update power/notification specs to expect (#13497)
* spec: update power/process specs to expect

* Address comments
2018-09-01 08:52:32 +12:00

17 lines
562 B
JavaScript

const {powerSaveBlocker} = require('electron').remote
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const {expect} = chai
chai.use(dirtyChai)
describe('powerSaveBlocker module', () => {
it('can be started and stopped', () => {
expect(powerSaveBlocker.isStarted(-1)).to.be.false()
const id = powerSaveBlocker.start('prevent-app-suspension')
expect(id).to.to.be.a('number')
expect(powerSaveBlocker.isStarted(id)).to.be.true()
powerSaveBlocker.stop(id)
expect(powerSaveBlocker.isStarted(id)).to.be.false()
})
})