How to use the check-error.compatibleMessage function in check-error

To help you get started, we’ve selected a few check-error 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 open-webrtc-toolkit / owt-client-javascript / test / unit / resources / scripts / deps / chai-as-promised.js View on Github external
reason => {
                const errorLikeCompatible = errorLike && (errorLike instanceof Error ?
                                                        checkError.compatibleInstance(reason, errorLike) :
                                                        checkError.compatibleConstructor(reason, errorLike));

                const errMsgMatcherCompatible = errMsgMatcher && checkError.compatibleMessage(reason, errMsgMatcher);

                const reasonName = getReasonName(reason);

                if (negate && everyArgIsDefined) {
                    if (errorLikeCompatible && errMsgMatcherCompatible) {
                        this.assert(true,
                                    null,
                                    "expected promise not to be rejected with #{exp} but it was rejected " +
                                    "with #{act}",
                                    errorLikeName,
                                    reasonName);
                    }
                } else {
                    if (errorLike) {
                        this.assert(errorLikeCompatible,
                                    "expected promise to be rejected with #{exp} but it was rejected with #{act}",
github open-webrtc-toolkit / owt-client-javascript / test / unit / resources / scripts / deps / chai-as-promised-browserified.js View on Github external
reason => {
                const errorLikeCompatible = errorLike && (errorLike instanceof Error ?
                                                        checkError.compatibleInstance(reason, errorLike) :
                                                        checkError.compatibleConstructor(reason, errorLike));

                const errMsgMatcherCompatible = errMsgMatcher && checkError.compatibleMessage(reason, errMsgMatcher);

                const reasonName = getReasonName(reason);

                if (negate && everyArgIsDefined) {
                    if (errorLikeCompatible && errMsgMatcherCompatible) {
                        this.assert(true,
                                    null,
                                    "expected promise not to be rejected with #{exp} but it was rejected " +
                                    "with #{act}",
                                    errorLikeName,
                                    reasonName);
                    }
                } else {
                    if (errorLike) {
                        this.assert(errorLikeCompatible,
                                    "expected promise to be rejected with #{exp} but it was rejected with #{act}",
github RxJSInAction / rxjs-in-action / app / js / helpers / chai-as-promised-bundle.js View on Github external
function (reason) {
                var errorLikeCompatible = errorLike && (errorLike instanceof Error ?
                                                        checkError.compatibleInstance(reason, errorLike) :
                                                        checkError.compatibleConstructor(reason, errorLike));

                var errMsgMatcherCompatible = errMsgMatcher && checkError.compatibleMessage(reason, errMsgMatcher);

                var reasonName = getReasonName(reason);

                if (negate && everyArgIsDefined) {
                    if (errorLikeCompatible && errMsgMatcherCompatible) {
                        that.assert(true,
                                    null,
                                    "expected promise not to be rejected with #{exp} but it was rejected " +
                                    "with #{act}",
                                    errorLikeName,
                                    reasonName);
                    }
                }
                else {
                    if (errorLike) {
                        that.assert(errorLikeCompatible,
github untool / untool / packages / core / lib / resolver.js View on Github external
exports.isResolveError = (error) => compatibleMessage(error, /^Can't resolve/);
github untool / untool / packages / core / lib / loader.js View on Github external
settings.presets = this.getDependencies().filter((dep) => {
        try {
          return !!this.loadPreset(context, dep);
        } catch (error) {
          if (!compatibleMessage(error, /^Can't find preset/)) throw error;
        }
      });
    }

check-error

Error comparison and information related utility for node and the browser

MIT
Latest version published 7 months ago

Package Health Score

73 / 100
Full package analysis