"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toEmitNext = void 0;
const toEmitNext = async function (actual, options) {
    const stream = actual;
    const hint = this.utils.matcherHint(this.isNot ? ".not.toEmitValue" : "toEmitValue", "stream", "expected");
    try {
        await stream.takeNext(options);
        return {
            pass: true,
            message: () => {
                return hint + "\n\nExpected stream not to emit a value 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 emit a value but it did not.",
            };
        }
        else {
            throw error;
        }
    }
};
exports.toEmitNext = toEmitNext;
//# sourceMappingURL=toEmitNext.cjs.map
