spec: move powerSaveBlocker spec to main process (#19236)
This commit is contained in:
parent
a4cffd29b7
commit
f101c72cbe
2 changed files with 13 additions and 17 deletions
13
spec-main/api-power-save-blocker-spec.ts
Normal file
13
spec-main/api-power-save-blocker-spec.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { expect } from 'chai'
|
||||
import { powerSaveBlocker } from 'electron'
|
||||
|
||||
describe('powerSaveBlocker module', () => {
|
||||
it('can be started and stopped', () => {
|
||||
expect(powerSaveBlocker.isStarted(-1)).to.be.false('is started')
|
||||
const id = powerSaveBlocker.start('prevent-app-suspension')
|
||||
expect(id).to.to.be.a('number')
|
||||
expect(powerSaveBlocker.isStarted(id)).to.be.true('is started')
|
||||
powerSaveBlocker.stop(id)
|
||||
expect(powerSaveBlocker.isStarted(id)).to.be.false('is started')
|
||||
})
|
||||
})
|
|
@ -1,17 +0,0 @@
|
|||
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()
|
||||
})
|
||||
})
|
Loading…
Reference in a new issue