diff --git a/spec/api-power-save-blocker-spec.js b/spec/api-power-save-blocker-spec.js new file mode 100644 index 000000000000..be97bcb301a6 --- /dev/null +++ b/spec/api-power-save-blocker-spec.js @@ -0,0 +1,13 @@ +const {powerSaveBlocker} = require('electron').remote +const assert = require('assert') + +describe('powerSaveBlocker module', () => { + it('can be started and stopped', () => { + assert.equal(powerSaveBlocker.isStarted(-1), false) + const id = powerSaveBlocker.start('prevent-app-suspension') + assert.ok(id != null) + assert.equal(powerSaveBlocker.isStarted(id), true) + powerSaveBlocker.stop(id) + assert.equal(powerSaveBlocker.isStarted(id), false) + }) +})