このコミットが含まれているのは:
2026-10-12 21:34:02 +09:00
コミット 11e6f73287
17個のファイルの変更、524行の追加、22行の削除
+3 -3
ファイルの表示
@@ -4,7 +4,7 @@ import { vi } from 'vitest'
import source from '@/lib/help.ts?raw'
import type { ReactElement } from 'react'
import type { ComponentType } from 'react'
import type * as Help from '@/lib/help'
@@ -38,11 +38,11 @@ export const createHelpFixture = () => {
vi.fn (async () => `# ${title}\n\n${body}`)]))
const moduleLoads = Object.fromEntries (published.map (([id, language, edition, title, body]) => [
`../../help/${id}/editions/${language}/${edition}.mdx`,
vi.fn (async (): Promise<{ default: () => ReactElement }> => ({
vi.fn (async (): Promise<{ default: ComponentType }> => ({
default: () => createElement ('div', null,
createElement ('h1', null, title), createElement ('p', null, body)) }))]))
// Dynamic imports reuse a module namespace even when called more than once.
const caches: Record<string, { promise?: Promise<{ default: () => ReactElement }> }> = { }
const caches: Record<string, { promise?: Promise<{ default: ComponentType }> }> = { }
const modules = Object.fromEntries (Object.entries (moduleLoads).map (([path, load]) => {
caches[path] = { }
return [path, vi.fn (() => caches[path].promise ??= load ())]