31 lines
822 B
TypeScript
31 lines
822 B
TypeScript
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() {
|
|
this.timeout(10000);
|
|
|
|
beforeEach(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();
|
|
});
|
|
|
|
afterEach(function() {
|
|
if (this.app && this.app.isRunning()) {
|
|
return this.app.stop();
|
|
}
|
|
});
|
|
|
|
it('shows an initial window @slow', function() {
|
|
return this.app.client.getWindowCount().then((count: number) => {
|
|
expect(count).to.be.gte(1);
|
|
});
|
|
});
|
|
});
|