RenaiApp/tests/main.spec.ts

34 lines
829 B
TypeScript
Raw Normal View History

import rewiremock from 'rewiremock';
rewiremock.disable();
import { expect } from 'chai';
import * as electron from 'electron';
import 'mocha';
import { Application } from 'spectron';
2019-10-11 23:10:30 +02:00
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) => {
2019-10-10 19:44:39 +02:00
expect(count).to.be.gte(1);
});
});
});