From f101c72cbeb15693fdcdcd2fa42fcaf37f398eaa Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Mon, 15 Jul 2019 01:38:01 -0700 Subject: [PATCH] spec: move powerSaveBlocker spec to main process (#19236) --- spec-main/api-power-save-blocker-spec.ts | 13 +++++++++++++ spec/api-power-save-blocker-spec.js | 17 ----------------- 2 files changed, 13 insertions(+), 17 deletions(-) create mode 100644 spec-main/api-power-save-blocker-spec.ts delete mode 100644 spec/api-power-save-blocker-spec.js diff --git a/spec-main/api-power-save-blocker-spec.ts b/spec-main/api-power-save-blocker-spec.ts new file mode 100644 index 000000000000..f3745bdba53d --- /dev/null +++ b/spec-main/api-power-save-blocker-spec.ts @@ -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') + }) +}) diff --git a/spec/api-power-save-blocker-spec.js b/spec/api-power-save-blocker-spec.js deleted file mode 100644 index c5d68b823b5f..000000000000 --- a/spec/api-power-save-blocker-spec.js +++ /dev/null @@ -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() - }) -})