本文整理汇总了TypeScript中out.Platform.WINDOWS类的典型用法代码示例。如果您正苦于以下问题:TypeScript Platform.WINDOWS类的具体用法?TypeScript Platform.WINDOWS怎么用?TypeScript Platform.WINDOWS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Platform.WINDOWS类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: assertPack
test.ifNotCiOsx("nsis boring, MUI_HEADER", () => {
let installerHeaderPath: string | null = null
return assertPack("test-app-one", {
targets: Platform.WINDOWS.createTarget(["nsis"]),
devMetadata: {
build: {
nsis: {
oneClick: false,
}
}
},
effectiveOptionComputed: options => {
const defines = options[0]
assertThat(defines.MUI_HEADERIMAGE).isEqualTo(null)
assertThat(defines.MUI_HEADERIMAGE_BITMAP).isEqualTo(installerHeaderPath)
assertThat(defines.MUI_HEADERIMAGE_RIGHT).isEqualTo(null)
// speedup, do not build - another MUI_HEADER test will test build
return true
}
}, {
tempDirCreated: projectDir => {
installerHeaderPath = path.join(projectDir, "build", "installerHeader.bmp")
return copy(getTestAsset("installerHeader.bmp"), installerHeaderPath)
}
}
)
})
示例2: test
test("detect install-spinner, certificateFile/password", () => {
let platformPackager: CheckingWinPackager = null
let loadingGifPath: string = null
return assertPack("test-app-one", {
targets: Platform.WINDOWS.createTarget("squirrel"),
platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingWinPackager(packager),
config: {
win: {
certificatePassword: "pass",
}
}
}, {
projectDirCreated: it => {
loadingGifPath = path.join(it, "build", "install-spinner.gif")
return BluebirdPromise.all([
copyTestAsset("install-spinner.gif", loadingGifPath),
modifyPackageJson(it, data => {
data.build.win = {
certificateFile: "secretFile",
certificatePassword: "mustBeOverridden",
}
})])
},
packed: async () => {
expect(platformPackager.effectiveDistOptions.loadingGif).toEqual(loadingGifPath)
expect(platformPackager.signOptions.cert).toEqual("secretFile")
expect(platformPackager.signOptions.password).toEqual("pass")
},
})
})
示例3: assertPack
test.ifNotCiOsx("nsis boring, MUI_HEADER as option", () => {
let installerHeaderPath: string | null = null
return assertPack("test-app-one", {
targets: Platform.WINDOWS.createTarget(["nsis"]),
devMetadata: {
build: {
nsis: {
oneClick: false,
installerHeader: "foo.bmp"
}
}
},
effectiveOptionComputed: options => {
const defines = options[0]
assertThat(defines.MUI_HEADERIMAGE).isEqualTo(null)
assertThat(defines.MUI_HEADERIMAGE_BITMAP).isEqualTo(installerHeaderPath)
assertThat(defines.MUI_HEADERIMAGE_RIGHT).isEqualTo(null)
// test that we can build such installer
return false
}
}, {
tempDirCreated: projectDir => {
installerHeaderPath = path.join(projectDir, "foo.bmp")
return rename(path.join(projectDir, "installerHeader.bmp"), installerHeaderPath)
}
}
)
})
示例4: test
test("detect install-spinner", () => {
let platformPackager: CheckingWinPackager = null
let loadingGifPath: string = null
// todo all PackagerOptions should be optional otherwise it is not possible to pass only several to override dev package.json
const devMetadata: any = {
build: {
win: {
certificatePassword: "pass",
}
}
}
return assertPack("test-app-one", {
targets: Platform.WINDOWS.createTarget(),
platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingWinPackager(packager, cleanupTasks),
devMetadata: devMetadata
}, {
tempDirCreated: it => {
loadingGifPath = path.join(it, "build", "install-spinner.gif")
return BluebirdPromise.all([
move(path.join(it, "install-spinner.gif"), loadingGifPath),
modifyPackageJson(it, data => {
data.build.win = {
certificateFile: "secretFile",
certificatePassword: "mustBeOverridden",
}
})])
},
packed: () => {
assertThat(platformPackager.effectiveDistOptions.loadingGif).equal(loadingGifPath)
assertThat(platformPackager.effectiveDistOptions.certificateFile).equal("secretFile")
return BluebirdPromise.resolve(null)
},
})
})
示例5: assertPack
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 => {
installerHeaderPath = path.join(projectDir, "foo.bmp")
return copyTestAsset("installerHeader.bmp", installerHeaderPath)
},
}
)
})
示例6: test
test("detect install-spinner, certificateFile/password", () => {
let platformPackager: CheckingWinPackager = null
let loadingGifPath: string = null
return assertPack("test-app-one", {
targets: Platform.WINDOWS.createTarget(),
platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingWinPackager(packager, cleanupTasks),
devMetadata: {
build: {
win: {
certificatePassword: "pass",
}
}
}
}, {
tempDirCreated: it => {
loadingGifPath = path.join(it, "build", "install-spinner.gif")
return BluebirdPromise.all([
move(path.join(it, "install-spinner.gif"), loadingGifPath),
modifyPackageJson(it, data => {
data.build.win = {
certificateFile: "secretFile",
certificatePassword: "mustBeOverridden",
}
})])
},
packed: () => {
assertThat(platformPackager.effectiveDistOptions.loadingGif).isEqualTo(loadingGifPath)
assertThat(platformPackager.signOptions.cert).isEqualTo("secretFile")
assertThat(platformPackager.signOptions.password).isEqualTo("pass")
return BluebirdPromise.resolve(null)
},
})
})
示例7: assertPack
test.ifDevOrWinCi("beta version", () => {
const metadata: any = {
version: "3.0.0-beta.2"
}
return assertPack("test-app-one", {
targets: Platform.WINDOWS.createTarget(["squirrel", "nsis"]),
devMetadata: metadata
})
})
示例8: assertPack
test.ifDevOrLinuxCi("nsis - custom include", () => assertPack("test-app-one", {
targets: Platform.WINDOWS.createTarget(["nsis"]),
}, {
tempDirCreated: projectDir => copy(getTestAsset("installer.nsh"), path.join(projectDir, "build", "installer.nsh")),
packed: projectDir => BluebirdPromise.all([
assertThat(path.join(projectDir, "build", "customHeader")).isFile(),
assertThat(path.join(projectDir, "build", "customInit")).isFile(),
assertThat(path.join(projectDir, "build", "customInstall")).isFile(),
]),
}))