Fix undefined rimraf issue after update

This commit is contained in:
Juan Cruz Viotti 2014-12-10 13:51:56 -04:00
parent 06f6b47fd1
commit 890d672671
2 changed files with 5 additions and 1 deletions

View File

@ -140,7 +140,7 @@ exports.has = haltIfNoPrefix (key, callback) ->
# resin.data.remove 'token', (error) ->
# throw error if error?
#
exports.remove = haltIfNoPrefix (key, callback) ->
exports.remove = haltIfNoPrefix (key, callback = _.noop) ->
try
keyPath = constructPath(key)
catch error

View File

@ -244,3 +244,7 @@ describe 'Data:', ->
data.remove [ 1, 2, 3 ], (error) ->
expect(error).to.be.an.instanceof(Error)
done()
it 'should not throw an error if no callback is passed', ->
func = _.partial(data.remove, FILESYSTEM.directory.key)
expect(func).to.not.throw(Error)