Closed falkenhawk closed 5 years ago
it just struck me I can still configure it after creating the mock...:
const ctx = createMockContext({ url, headers });
ctx.app.subdomainOffset = subdomainOffset;
console.log(ctx.subdomains); // now resolved with passed subdomainOffset
Overview
Please allow passing
subdomainOffset
which would then be set on the koa app's instance insidecreateContext
function. MaybecustomProperties
could be used for that. This is necessary to control howctx.subdomains
array is constructed from requestedurl
. https://koajs.com/#settingsType
Motivation
I think that's the only thing which is missing to fully mock the koa's context object.