RenaiApp/test/integration/launch.spec.ts

31 lines
891 B
TypeScript
Raw Normal View History

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 Launch', 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', function(): any {
return this.app.client.getWindowCount().then((count: number) => {
expect(count).to.equal(1, 'there is not one window open on app start');
});
});
});