import { expect } from 'chai'; import * as electron from 'electron'; import { afterEach, beforeEach, describe, it } from 'mocha'; import { Application } from 'spectron'; import packageJson from '../../package.json'; describe('Application', function(): void { this.timeout('10s'); beforeEach(function(): any { 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(); }); afterEach(function(): any { if (this.app && this.app.isRunning()) { return this.app.stop(); } }); it('shows an initial window @slow', function(): any { return this.app.client.getWindowCount().then((count: number) => { expect(count).to.be.gte(1); }); }); });