"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toComplete = void 0;
const toComplete = async function (actual, options) {
    const stream = actual;
    const hint = this.utils.matcherHint("toComplete", "stream", "");
    try {
        await stream.takeComplete(options);
        return {
            pass: true,
            message: () => {
                return hint + "\n\nExpected stream not to complete but it did.";
            },
        };
    }
    catch (error) {
        if (error instanceof Error &&
            error.message === "Timeout waiting for next event") {
            return {
                pass: false,
                message: () => hint + "\n\nExpected stream to complete but it did not.",
            };
        }
        else {
            throw error;
        }
    }
};
exports.toComplete = toComplete;
//# sourceMappingURL=toComplete.cjs.map
