assert.ifError(value)
Throws value
if value
is truthy. This is useful when testing the error
argument in callbacks.
const assert = require('assert'); assert.ifError(0); // OK assert.ifError(1); // Throws 1 assert.ifError('error') // Throws 'error' assert.ifError(new Error()); // Throws Error
Please login to continue.