How to use the power-assert.AssertionError 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 cloudflare / collapsify / test / collapsers / html.js View on Github external
fetch: function (url) {
        switch (url) {
          case 'https://terinstock.com':
            return Bluebird.resolve(new Buffer('<h1>Hi.</h1><img src="avatar.jpeg">'));
          case 'https://terinstock.com/avatar.jpeg':
            return Bluebird.resolve(new Buffer(''));
          default:
            return Bluebird.reject(new assert.AssertionError('unknown resource resolution'));
        }
      },
      resourceLocation: 'https://terinstock.com'