method MockResponse.prototype.appendHeader
MockResponse.prototype.appendHeader(
name: string,
value: string
): IResponse

Appends a response header, preserving any existing values for the same name rather than replacing them (unlike IResponse.header, which overwrites). This is the correct way to emit multiple headers of the same name — most notably several Set-Cookie headers (e.g. an access cookie plus a refresh cookie, or deleting several cookies at once).

Parameters

name: string

Header name

value: string

Header value to add

Return Type

IResponse

This response, for chaining

Usage

import { MockResponse } from "testing/src/index.ts";