Add test for #378 and #386

This commit is contained in:
Yuya Ochiai
2016-12-27 22:10:53 +09:00
parent 3bf41ca3e5
commit 0e6ba99e36
2 changed files with 49 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ const chaiAsPromised = require('chai-as-promised');
chai.should();
chai.use(chaiAsPromised);
const fs = require('fs');
const path = require('path');
const Application = require('spectron').Application;
@@ -19,12 +20,27 @@ const electronBinaryPath = (() => {
})();
const userDataDir = path.join(sourceRootDir, 'test/testUserData/');
const configFilePath = path.join(userDataDir, 'config.json');
const boundsInfoPath = path.join(userDataDir, 'bounds-info.json');
const mattermostURL = 'http://example.com/team';
module.exports = {
sourceRootDir,
configFilePath,
boundsInfoPath,
mattermostURL,
cleanTestConfig() {
[configFilePath, boundsInfoPath].forEach((file) => {
try {
fs.unlinkSync(file);
} catch (err) {
if (err.code !== 'ENOENT') {
console.error(err);
}
}
});
},
getSpectronApp() {
const app = new Application({
path: electronBinaryPath,