Skip to content

Commit 027bfb9

Browse files
committed
Add callback to unlink functions to get rid of deprecation messages
1 parent 81b38e4 commit 027bfb9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
var test = require('tape')
22
var tapSpec = require('tap-spec')
3+
function noop (err) { if (err) throw err }
4+
35
test.createStream()
46
.pipe(tapSpec())
57
.pipe(process.stdout)
@@ -42,7 +44,7 @@ test('pdf.create(html[, options]).toFile([filename, ]callback)', function (t) {
4244
pdf.create(html).toFile(function (err, pdf) {
4345
t.error(err)
4446
t.assert(typeof pdf.filename === 'string', `toFile(callback) returns {filename: '${pdf.filename}'} as second cb argument`)
45-
fs.unlink(pdf.filename)
47+
fs.unlink(pdf.filename, noop)
4648
})
4749

4850
var file = path.join(__dirname, 'simple.pdf')
@@ -82,7 +84,7 @@ test('pdf.create(html[, options]).toStream(callback)', function (t) {
8284
stream.pipe(fs.createWriteStream(destination))
8385
stream.on('end', function () {
8486
t.assert(fs.existsSync(destination), 'toStream returns a working readable stream')
85-
fs.unlink(destination)
87+
fs.unlink(destination, noop)
8688
})
8789
})
8890
})

0 commit comments

Comments
 (0)