context = (t, metadata = undefined) => {
    if (t.context instanceof TestContext) {
        t.context.t = t;
    } else {
        t.context = new TestContext(t);
    }

    Object.assign(t.context.metadata, metadata || {});

    return t.context;
}
@template {object} T
@param {import('ava').ExecutionContext} t
@param {T} [metadata]
@returns {TestContext<T>}