/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ /** * Validates that an error thrown by our `assert()` function has the expected message, or a * short code that corresponds to that message. * * @remarks * The main use case for this is so tests that expect specific assert() calls to fail can * always do comparisons based on the original string message, and work whether they run * before the policy-check tool replaces those strings with short codes, or after. Note that * it either returns true or throws an error (the behavior expected by NodeJS' `assert.throws()`). * * @param expectedErrorMessage - The message that the error object should match (either explicitly, * or because it contains a short code which maps to that message). * @returns an error validation function suitable for use with NodeJS's `assert.throws()`. * @internal */ export declare function validateAssertionError(expectedErrorMsg: string | RegExp): (error: Error) => true; /** * {@link validateError} for `UsageError`. * @internal */ export declare function validateUsageError(expectedErrorMsg: string | RegExp): (error: Error) => true; /** * {@link validateError} for `TypeError`. * @internal */ export declare function validateTypeError(expectedErrorMsg: string | RegExp): (error: Error) => true; /** * Validates that a specific kind of error was thrown with the expected message. * @remarks * Intended for use with NodeJS's `assert.throws`. * @see {@link validateAssertionError}, {@link validateUsageError}, {@link validateTypeError} for more specialized versions. * @returns an error validation function suitable for use with NodeJS's `assert.throws()`. * @internal */ export declare function validateError(expectedErrorMsg: string | RegExp, errorType?: new (...args: any[]) => Error): (error: Error) => true; //# sourceMappingURL=validateAssertionError.d.ts.map