import rewiremock from 'rewiremock'; rewiremock.disable(); import { expect } from 'chai'; import * as electron from 'electron'; import 'mocha'; import { Application } from 'spectron'; import packageJson from '../package.json'; describe('Application @slow', function() { this.timeout(20000); before(function() { this.app = new Application({ // @ts-ignore this does give the path to electron executable (hopefully platform agnostic) path: electron.default, args: [packageJson.main], }); return this.app.start(); }); after(function() { if (this.app && this.app.isRunning()) { return this.app.stop(); } }); it('shows an initial window', function() { return this.app.client.getWindowCount().then((count: number) => { expect(count).to.be.gte(1); }); }); });