UNPKG

promisify-tuple

Version:

Promisify a callback-style function, always resolve with [err,val]

12 lines (10 loc) 266 B
const test = require('tape'); const run = require('./index'); const fs = require('fs'); test('it can be used fs.readFile', async t => { t.plan(3); const [err, val] = await run(fs.readFile)('./test.js'); t.error(err); t.ok(val); t.ok(val.length > 10); });