Skip to content

Commit a43e0af

Browse files
committed
Add spec for non-existent password path
1 parent 0b5ae7e commit a43e0af

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/signcode-test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,24 @@ describe('signcode', function () {
138138
})
139139
})
140140

141+
it('calls back with an error when a non-existent password file is specified', function (done) {
142+
var tempPath = temp.path({suffix: '.exe'})
143+
fs.writeFileSync(tempPath, fs.readFileSync(path.join(__dirname, 'fixtures', 'electron.exe')))
144+
145+
var options = {
146+
cert: path.join(__dirname, 'fixtures', 'cert-with-pw.pem'),
147+
hash: ['sha1', 'sha256'],
148+
key: path.join(__dirname, 'fixtures', 'key-with-pw.pem'),
149+
passwordPath: path.join(__dirname, 'fixtures', 'not-password.txt'),
150+
path: tempPath
151+
}
152+
153+
signcode.sign(options, function (error) {
154+
assert(error.message.length > 0)
155+
done()
156+
})
157+
})
158+
141159
it('calls back with an error when an invalid certificate is specified', function (done) {
142160
var tempPath = temp.path({suffix: '.exe'})
143161
fs.writeFileSync(tempPath, fs.readFileSync(path.join(__dirname, 'fixtures', 'electron.exe')))

0 commit comments

Comments
 (0)