aboutsummaryrefslogtreecommitdiff
path: root/common/font.test.ts
blob: 99a568d1b56f589599a8bf2579d4a3f7c73c03bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
 * @jest-environment node
 */

import { SatoriOptions } from 'satori'
import { getFont } from './renderCard'
import { Font } from './types/configType'

describe('Verify Fonts', () => {
  for (const item in Font) {
    const fontName = Font[item as keyof typeof Font]

    for (const weight of [200, 400, 500]) {
      test(`Check font '${fontName}', ${weight} exists`, async () => {
        const { data } = await getFont(
          fontName,
          weight as SatoriOptions['fonts'][0]['weight']
        )
        expect(data).toBeTruthy()
      })
    }
  }
})