Skip to content

Commit

Permalink
chore(fff/ptd): ✅ add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaa committed Dec 15, 2023
1 parent 279d3c8 commit 1eecb21
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/fff-flavored-frontmatter/test/utils/ptd.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { describe, expect, it } from 'vitest'

import { type FFFFlavoredFrontmatter, postTypeDiscovery } from '../../src'

describe('fff-flavored-frontmatter ptd util', () => {
it('article', () => {
const article: FFFFlavoredFrontmatter = {
summary: 'Hello, World!',
title: 'Hello, World!',
}

expect(postTypeDiscovery(article)).toEqual('article')
})

it('note', () => {
const note: FFFFlavoredFrontmatter = {
summary: 'foo',
tags: ['bar'],
}

expect(postTypeDiscovery(note)).toEqual('note')
})
})

0 comments on commit 1eecb21

Please sign in to comment.