Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
opts.path = electron // this means spectron will use electron located in node_modules
opts.args = [ appMain ] // in this mode, we need to specify the main.js to use
}
if (process.env.CHROMEDRIVER_PORT) {
opts.port = process.env.CHROMEDRIVER_PORT
}
if (process.env.WSKNG_NODE_DEBUG) {
// pass WSKNG_DEBUG on to NODE_DEBUG for the application
opts.env.NODE_DEBUG = process.env.WSKNG_NODE_DEBUG
}
if (process.env.DEBUG) {
opts.env.DEBUG = process.env.DEBUG
}
return new Application(opts)
}
pathToBinary = path.join(__dirname, '../dist/linux-unpacked/hyper');
break;
case 'darwin':
pathToBinary = path.join(__dirname, '../dist/mac/Hyper.app/Contents/MacOS/Hyper');
break;
case 'win32':
pathToBinary = path.join(__dirname, '../dist/win-unpacked/Hyper.exe');
break;
default:
throw new Error('Path to the built binary needs to be defined for this platform in test/index.js');
}
app = new Application({
path: pathToBinary
});
await app.start();
});
before(function () {
var fsprefix = "_myubo_test" + Date.now().toString(36);
var dirPath = temp.mkdirSync(fsprefix);
this.app = new spectron_1.Application({
path: 'MYukkuriVoice-darwin-x64/MYukkuriVoice.app/Contents/MacOS/MYukkuriVoice',
env: { DEBUG: 1, NODE_ENV: 'test', userData: dirPath }
});
return this.app.start();
});
after(function () {
before(async () => {
app = new Application({path: "node_modules/.bin/electron", args: ["."]});
});
before(function () {
var fsprefix = "_myubo_test" + Date.now().toString(36);
dirPath = temp.mkdirSync(fsprefix);
this.app = new spectron_1.Application({
path: 'MYukkuriVoice-darwin-x64/MYukkuriVoice.app/Contents/MacOS/MYukkuriVoice',
env: { DEBUG: 1, NODE_ENV: 'test', userData: dirPath }
});
return this.app.start();
});
after(function () {
before('start electron', function() {
app = new Application({
path: Path.join(__dirname, '../node_modules/.bin/electron'),
args: [Path.join(__dirname, '..')],
});
return app.start();
});
before(function () {
var fsprefix = "_myubo_test" + Date.now().toString(36);
dirPath = temp.mkdirSync(fsprefix);
this.app = new spectron_1.Application({
path: 'MYukkuriVoice-darwin-x64/MYukkuriVoice.app/Contents/MacOS/MYukkuriVoice',
env: { DEBUG: 1, NODE_ENV: 'test', userData: dirPath }
});
return this.app.start();
});
after(function () {
function createApp (t) {
var app = new spectron.Application({
path: path.join(__dirname, '../node_modules/.bin/electron'),
args: [
path.join(__dirname, '../index.js'),
'--data',
TEST_DATA,
'--db',
TEST_DATA_DB
],
env: {
NODE_ENV: 'test',
RUNNING_IN_SPECTRON: true,
OPEN_RESULT: FIXTURES
}
})
process.on('SIGTERM', () => endTest(app))
return app
let startApplication = () => {
return new Application({
path: getElectronPath(),
args: [resolve(__dirname, '../../build')],
env: { SPECTRON: true }
}).start();
}
const beforeEach = function (env = {}) {
this.timeout(50000);
this.app = new Application({
path: electron,
args: ['.', 'test'],
startTimeout: 50000,
waitTimeout: 50000,
chromeDriverLogPath: process.cwd().concat('/chrome-driver.log'),
webdriverLogPath: process.cwd(),
env: Object.assign(env, {
DEBUG: 'false',
NAME: 'test',
}),
});
return this.app.start();
};