2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-12-23 18:48:55 +00:00
nativefier/test/index.js
Kenneth G. Franqueiro a360f6c2ee Add more comprehensive tests
This implements the following cases:

* Basic runs for a specific version/platform/arch with default options
  (testing for existence of expected output files/folders)
* Runs for each target platform with `out` set
* Runs for each target platform with `asar` set
* Runs for each target platform with `prune` set
* Runs for each target platform with `ignore` set
  * This includes testing `ignore` including a path separator
  * This also includes testing that `ignore` entries are applied
    with the app folder trimmed
* Runs for each target platform with `overwrite` set / not set
* Runs with `all` set, with `arch` or `platform` each set to `all`,
  and with `platform` set to multiple platforms (comma-delimited or
  array)
* Tests specifically for the darwin target platform, to test
  `icon` and `sign`

The test logic is organized such that the version of Electron being
tested can be configured once centrally (in config.json), and the tests
will not run until after downloading any necessary electron versions
(to avoid timing out due to long downloads).

Resolves #77.
2015-06-28 16:57:59 -04:00

28 lines
802 B
JavaScript

var exec = require('child_process').exec
var path = require('path')
var series = require('run-series')
var config = require('./config.json')
var util = require('./util')
// Download all Electron distributions before running tests to avoid timing out due to network speed
series([
function (cb) {
console.log('Calling electron-download before running tests...')
util.downloadAll(config.version, cb)
}, function (cb) {
console.log('Running npm install in fixtures/basic...')
exec('npm install', {cwd: path.join(__dirname, 'fixtures', 'basic')}, cb)
}
], function () {
console.log('Running tests...')
require('./basic')
require('./multitarget')
if (process.platform !== 'win32') {
// Perform additional tests specific to building for OS X
require('./mac')
}
})