Load test page and run tests on start when NODE_ENV=test
FREEBIE
This commit is contained in:
parent
5a88faf334
commit
b4e3cc0e6c
5 changed files with 27 additions and 16 deletions
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"serverUrl": "https://textsecure-service-staging.whispersystems.org",
|
||||||
"disableAutoUpdate": false,
|
"disableAutoUpdate": false,
|
||||||
"openDevTools": false,
|
"openDevTools": false,
|
||||||
"buildExpiration": 0
|
"buildExpiration": 0
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"serverUrl": "https://textsecure-service-staging.whispersystems.org",
|
|
||||||
"storageProfile": "development",
|
"storageProfile": "development",
|
||||||
"disableAutoUpdate": true,
|
"disableAutoUpdate": true,
|
||||||
"openDevTools": true
|
"openDevTools": true
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"serverUrl": "https://textsecure-service-staging.whispersystems.org",
|
|
||||||
"storageProfile": "staging",
|
"storageProfile": "staging",
|
||||||
"disableAutoUpdate": true,
|
"disableAutoUpdate": true,
|
||||||
"openDevTools": true
|
"openDevTools": true
|
||||||
|
|
5
config/test.json
Normal file
5
config/test.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"storageProfile": "test",
|
||||||
|
"disableAutoUpdate": true,
|
||||||
|
"openDevTools": true
|
||||||
|
}
|
35
main.js
35
main.js
|
@ -96,20 +96,27 @@ function createWindow () {
|
||||||
event.returnValue = localeData;
|
event.returnValue = localeData;
|
||||||
});
|
});
|
||||||
|
|
||||||
// and load the index.html of the app.
|
function prepareURL(pathSegments) {
|
||||||
mainWindow.loadURL(url.format({
|
return url.format({
|
||||||
pathname: path.join(__dirname, 'background.html'),
|
pathname: path.join.apply(null, pathSegments),
|
||||||
protocol: 'file:',
|
protocol: 'file:',
|
||||||
slashes: true,
|
slashes: true,
|
||||||
query: {
|
query: {
|
||||||
locale: locale,
|
locale: locale,
|
||||||
version: package_json.version,
|
version: package_json.version,
|
||||||
buildExpiration: config.get('buildExpiration'),
|
buildExpiration: config.get('buildExpiration'),
|
||||||
serverUrl: config.get('serverUrl'),
|
serverUrl: config.get('serverUrl'),
|
||||||
environment: environment,
|
environment: environment,
|
||||||
node_version: process.versions.node
|
node_version: process.versions.node
|
||||||
}
|
}
|
||||||
}))
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === 'test') {
|
||||||
|
mainWindow.loadURL(prepareURL([__dirname, 'test', 'index.html']));
|
||||||
|
} else {
|
||||||
|
mainWindow.loadURL(prepareURL([__dirname, 'background.html']));
|
||||||
|
}
|
||||||
|
|
||||||
if (config.get('openDevTools')) {
|
if (config.get('openDevTools')) {
|
||||||
// Open the DevTools.
|
// Open the DevTools.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue