feat(v2): improve DocFrontMatter schema validation (#4796)

Co-authored-by: Nam Hoang Le <nam.hoang.le@mgm-tp.com>
This commit is contained in:
Nam Hoang Le 2021-05-18 21:14:09 +07:00 committed by GitHub
parent 0360364570
commit fa7aa08100
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 193 additions and 27 deletions

View file

@ -251,9 +251,10 @@ describe('validateBlogPostFrontMatter', () => {
testField({
fieldName: 'date',
validFrontMatters: [
// @ts-expect-error: number for test
{date: new Date('2020-01-01')},
// @ts-expect-error: string for test
{date: '2020-01-01'},
// @ts-expect-error: string for test
{date: '2020'},
],
invalidFrontMatters: [