|
1 | 1 | import { Arch, build, Platform } from "electron-builder" |
2 | | -import { move, remove, rename } from "fs-extra-p" |
| 2 | +import { copyFile, move, remove, rename } from "fs-extra-p" |
3 | 3 | import * as path from "path" |
4 | 4 | import { assertThat } from "../helpers/fileAssert" |
5 | 5 | import { app, appThrows, modifyPackageJson } from "../helpers/packTester" |
@@ -83,8 +83,36 @@ test.ifNotWindows("icons from ICNS (mac)", app({ |
83 | 83 | }, |
84 | 84 | }, |
85 | 85 | }, { |
86 | | - projectDirCreated: it => move(path.join(it, "build", "icon.icns"), path.join(it, "resources", "time.icns")) |
87 | | - .then(() => remove(path.join(it, "build"))), |
| 86 | + projectDirCreated: async projectDir => { |
| 87 | + await move(path.join(projectDir, "build", "icon.icns"), path.join(projectDir, "resources", "time.icns")) |
| 88 | + await remove(path.join(projectDir, "build")) |
| 89 | + }, |
| 90 | + packed: async context => { |
| 91 | + const projectDir = context.getResources(Platform.LINUX) |
| 92 | + await assertThat(projectDir).isDirectory() |
| 93 | + }, |
| 94 | +})) |
| 95 | + |
| 96 | +test.ifNotWindows("icons from ICNS if nothing specified", app({ |
| 97 | + targets: appImageTarget, |
| 98 | + config: { |
| 99 | + publish: null, |
| 100 | + }, |
| 101 | +}, { |
| 102 | + projectDirCreated: async projectDir => { |
| 103 | + await remove(path.join(projectDir, "build", "icons")) |
| 104 | + }, |
| 105 | +})) |
| 106 | + |
| 107 | +test.ifNotWindows("icons from dir and one icon with suffix", app({ |
| 108 | + targets: appImageTarget, |
| 109 | + config: { |
| 110 | + publish: null, |
| 111 | + }, |
| 112 | +}, { |
| 113 | + projectDirCreated: async projectDir => { |
| 114 | + await copyFile(path.join(projectDir, "build", "icons", "16x16.png"), path.join(projectDir, "build", "icons", "16x16-dev.png")) |
| 115 | + }, |
88 | 116 | packed: async context => { |
89 | 117 | const projectDir = context.getResources(Platform.LINUX) |
90 | 118 | await assertThat(projectDir).isDirectory() |
|
0 commit comments