app.setBadgeCount should return boolean

This commit is contained in:
Cheng Zhao 2016-07-01 22:18:39 +09:00
parent f8ec377123
commit 1da2a1c2ae
6 changed files with 24 additions and 11 deletions

View file

@ -285,10 +285,17 @@ describe('app module', function () {
})
})
describe('app.getBadgeCount API', function () {
describe('app.setBadgeCount API', function () {
const shouldFail = process.platform === 'win32' ||
(process.platform === 'linux' && app.isUnityRunning())
it('returns false when failed', function () {
assert.equal(app.setBadgeCount(42), !shouldFail)
})
it('should set a badge count', function () {
app.setBadgeCount(42)
assert.equal(app.getBadgeCount(), 42)
assert.equal(app.getBadgeCount(), shouldFail ? 0 : 42)
})
})
})