Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test.ifNotCiMac("boring, MUI_HEADER as option", () => {
let installerHeaderPath: string | null = null
return assertPack("test-app-one", {
targets: Platform.WINDOWS.createTarget(["nsis"], Arch.ia32, Arch.x64),
config: {
nsis: {
oneClick: false,
installerHeader: "foo.bmp"
}
},
effectiveOptionComputed: async (it) => {
const defines = it[0]
expect(defines.MUI_HEADERIMAGE).toBeNull()
expect(defines.MUI_HEADERIMAGE_BITMAP).toEqual(installerHeaderPath)
expect(defines.MUI_HEADERIMAGE_RIGHT).toBeNull()
// test that we can build such installer
return false
}
}, {
projectDirCreated: projectDir => {
async function checkLinuxResult(outDir: string, packager: Packager, arch: Arch, nameToTarget: Map) {
if (!nameToTarget.has("deb")) {
return
}
const appInfo = packager.appInfo
const packageFile = `${outDir}/TestApp_${appInfo.version}_${arch === Arch.ia32 ? "i386" : (arch === Arch.x64 ? "amd64" : "armv7l")}.deb`
expect(await getContents(packageFile)).toMatchSnapshot()
if (arch === Arch.ia32) {
expect(await getContents(`${outDir}/TestApp_${appInfo.version}_i386.deb`)).toMatchSnapshot()
}
const control = parseDebControl(await execShell(`ar p '${packageFile}' control.tar.gz | ${await getTarExecutable()} zx --to-stdout ./control`, {
maxBuffer: 10 * 1024 * 1024,
}))
delete control.Version
delete control.Size
const description = control.Description
delete control.Description
expect(control).toMatchSnapshot()
// strange difference on linux and mac (no leading space on Linux)
expect(description.trim()).toMatchSnapshot()