How to use the power-assert.doc function in power-assert

To help you get started, we’ve selected a few power-assert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github esdoc / esdoc / test / src / ESDoc / Util / assert.js View on Github external
import assert from 'power-assert';
import Logger from '../../../../src/Util/Logger.js';

export default assert;

let TAG = 'assert';
assert.doc = function(doc, obj) {
  for (let key of Object.keys(obj)) {
    if (key in doc) {
      assert.deepEqual(doc[key], obj[key]);
    } else {
      Logger.w(TAG, `"${key}" is not found in doc. doc.longname = "${doc.longname}"`);
    }
  }
};