mockInquirer = async ({t, answers, mocks = {}}) => {
	/** @type {string[]} */
	const logs = [];

	/** @type {import('../../source/ui.js')} */
	const ui = await esmock('../../source/ui.js', import.meta.url, {
		inquirer: {
			async prompt(prompts) {
				let uiAnswers = {};

				const assertions = await t.try(async tt => {
					uiAnswers = await mockPrompt({t: tt, inputAnswers: answers, prompts});
				});

				assertions.commit({retainLogs: !assertions.passed});
				return uiAnswers;
			},
		},
	}, {
		...fixRelativeMocks(mocks),
		import: {
			console: {log: (...arguments_) => logs.push(...arguments_)},
		},
	});

	return {ui, logs};
}
Mocks `inquirer` for testing `source/ui.js`.

@param {object} o Test input and optional global mocks
@param {ExecutionContext} o.t
@param {Answers} o.answers Test input
@param {import('esmock').MockMap} [o.mocks] Optional global mocks