RenaiApp/test/integration/launch.spec.ts

30 lines
795 B
TypeScript

import * as assert from 'assert';
import { afterEach, beforeEach, describe, it } from 'mocha';
import * as path from 'path';
import { Application } from 'spectron';
import packageJson from '../../package.json';
describe('Application Launch', function(): void {
this.timeout('10s');
beforeEach(function(): any {
this.app = new Application({
path: path.resolve('node_modules', 'electron', 'dist', 'electron.exe'),
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) => {
assert.strictEqual(count, 1);
});
});
});