src/vs/workbench/api/common/extHostTypeConverters.ts/convertTestResultItem
	const convertTestResultItem = (item: TestResultItem.Serialized, byInternalId: Map<string, TestResultItem.Serialized>): vscode.TestResultSnapshot => {
		const snapshot: vscode.TestResultSnapshot = ({
			...TestItem.toPlain(item.item),
			parent: undefined,
			taskStates: item.tasks.map(t => ({
				state: t.state as number as types.TestResultState,
				duration: t.duration,
				messages: t.messages
					.filter((m): m is ITestErrorMessage.Serialized => m.type === TestMessageType.Error)
					.map(TestMessage.to),
			})),
			children: item.children
				.map(c => byInternalId.get(c))
				.filter(isDefined)
				.map(c => convertTestResultItem(c, byInternalId))
		});

		for (const child of snapshot.children) {
			(child as any).parent = snapshot;
		}

		return snapshot;
	};