fix(tests): simplify tests
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import electron from "electron";
|
||||
import { Application } from "spectron";
|
||||
|
||||
const beforeEach = function() {
|
||||
const startApplication = function() {
|
||||
this.timeout(30000);
|
||||
this.app = new Application({
|
||||
path: electron,
|
||||
@ -13,7 +13,7 @@ const beforeEach = function() {
|
||||
return this.app.start();
|
||||
};
|
||||
|
||||
const afterEach = function() {
|
||||
const stopApplication = function() {
|
||||
this.timeout(30000);
|
||||
if (this.app && this.app.isRunning()) {
|
||||
return this.app.stop();
|
||||
@ -21,7 +21,7 @@ const afterEach = function() {
|
||||
return undefined;
|
||||
};
|
||||
|
||||
export default {
|
||||
beforeEach,
|
||||
afterEach
|
||||
export {
|
||||
startApplication,
|
||||
stopApplication
|
||||
};
|
@ -1,12 +0,0 @@
|
||||
import { expect } from "chai";
|
||||
import testUtils from "./utils";
|
||||
|
||||
describe("application launch", () => {
|
||||
before(testUtils.beforeEach);
|
||||
after(testUtils.afterEach);
|
||||
|
||||
it("index page loaded", async function() {
|
||||
const { app } = this
|
||||
await app.client.waitForExist('#index-window')
|
||||
});
|
||||
});
|
@ -2,20 +2,10 @@ const expect = (is) => {
|
||||
if(!is)
|
||||
throw new Error('expected not done');
|
||||
}
|
||||
import testUtils from "./utils";
|
||||
|
||||
const {pool} = require('../src/background/mysql')
|
||||
const forBigTable = require('../src/background/forBigTable')
|
||||
|
||||
describe("big table for check", () => {
|
||||
before(testUtils.beforeEach);
|
||||
after(testUtils.afterEach);
|
||||
|
||||
it("runned", async function() {
|
||||
const { app } = this
|
||||
await app.client.waitForExist('#index-window')
|
||||
});
|
||||
|
||||
let sphinx;
|
||||
|
||||
it("init", function() {
|
||||
|
13
tests/init.js
Normal file
13
tests/init.js
Normal file
@ -0,0 +1,13 @@
|
||||
import {startApplication, stopApplication} from "../tests/application";
|
||||
|
||||
describe("application", () => {
|
||||
before(startApplication);
|
||||
after(stopApplication);
|
||||
|
||||
it("check start", async function() {
|
||||
const { app } = this
|
||||
await app.client.waitForExist('#index-window')
|
||||
});
|
||||
|
||||
//TESTS
|
||||
});
|
@ -1,18 +1,9 @@
|
||||
import { expect } from "chai";
|
||||
import testUtils from "./utils";
|
||||
|
||||
const mysql = require('mysql')
|
||||
const config = require('../src/background/config')
|
||||
|
||||
describe("sphinx", () => {
|
||||
before(testUtils.beforeEach);
|
||||
after(testUtils.afterEach);
|
||||
|
||||
it("runned", async function() {
|
||||
const { app } = this
|
||||
await app.client.waitForExist('#index-window')
|
||||
});
|
||||
|
||||
let sphinx;
|
||||
|
||||
it("init", function() {
|
||||
|
Reference in New Issue
Block a user