Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test.serial('defaults', util.testSinglePlatform(async (t, opts) => {
opts.name = 'defaultsTest'
opts.dir = util.fixtureSubdir('basic')
delete opts.platform
delete opts.arch
const defaultOpts = {
arch: getHostArch(),
name: opts.name,
platform: process.platform
}
const paths = await packager(opts)
t.true(Array.isArray(paths), 'packager call should resolve to an array')
t.is(paths.length, 1, 'Single-target run should resolve to a 1-item array')
const finalPath = paths[0]
t.is(finalPath, path.join(t.context.workDir, common.generateFinalBasename(defaultOpts)),
'Path should follow the expected format and be in the cwd')
await util.assertDirectory(t, finalPath, 'The expected output directory should exist')
const resourcesPath = path.join(finalPath, util.generateResourcesPath(defaultOpts))
const appPath = path.join(finalPath, generateNamePath(defaultOpts))
if (common.isPlatformMac(defaultOpts.platform)) {
validateListFromOptions: function validateListFromOptions (opts, name) {
if (opts.all) return Array.from(supported[name].values())
let list = opts[name]
if (!list) {
if (name === 'arch') {
list = getHostArch()
} else {
list = process[name]
}
} else if (list === 'all') {
return Array.from(supported[name].values())
}
if (!Array.isArray(list)) {
if (typeof list === 'string') {
list = list.split(/,\s*/)
} else {
return unsupportedListOption(name, list, supported[name])
}
}
const officialElectronPackages = usingOfficialElectronPackages(opts)