Skip to content

Commit 8266b22

Browse files
committed
fix: check that noMsi specified as bool
Closes #316
1 parent 82dcf6b commit 8266b22

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"command-line-args": "^2.1.6",
5959
"electron-packager-tf": "^6.0.3-beta.3",
6060
"electron-winstaller-fixed": "^2.2.1-beta.0",
61-
"fs-extra": "^0.26.7",
61+
"fs-extra": "^0.27.0",
6262
"fs-extra-p": "^0.2.0",
6363
"globby": "^4.0.0",
6464
"hosted-git-info": "^2.1.4",

src/winPackager.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,9 @@ function checkConflictingOptions(options: any) {
227227
throw new Error(`Option ${name} is ignored, do not specify it.`)
228228
}
229229
}
230+
231+
const noMsi = options.noMsi
232+
if (noMsi != null && typeof noMsi !== "boolean") {
233+
throw new Error(`noMsi expected to be boolean value, but string '"${noMsi}"' was specified`)
234+
}
230235
}

test/src/winPackagerTest.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ import * as assertThat from "should/as-function"
1111
//noinspection JSUnusedLocalSymbols
1212
const __awaiter = require("out/awaiter")
1313

14-
test.ifNotTravis("win", () => assertPack("test-app-one", {
15-
platform: [Platform.WINDOWS],
16-
},
14+
test.ifNotTravis("win", () => assertPack("test-app-one", platform(Platform.WINDOWS),
1715
{
1816
tempDirCreated: process.env.TEST_DELTA ? it => modifyPackageJson(it, data => {
1917
data.build.win = {
@@ -23,6 +21,16 @@ test.ifNotTravis("win", () => assertPack("test-app-one", {
2321
}
2422
))
2523

24+
test.ifNotTravis("noMsi as string", t => t.throws(assertPack("test-app-one", platform(Platform.WINDOWS),
25+
{
26+
tempDirCreated: it => modifyPackageJson(it, data => {
27+
data.build.win = {
28+
noMsi: "false",
29+
}
30+
})
31+
}), `noMsi expected to be boolean value, but string '"false"' was specified`)
32+
)
33+
2634
test("detect install-spinner", () => {
2735
let platformPackager: CheckingWinPackager = null
2836
let loadingGifPath: string = null

0 commit comments

Comments
 (0)