Skip to content

Commit

Permalink
fix Yaml / Joi validation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Apr 21, 2021
1 parent 5b0c416 commit fbfa345
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ describe('validateFrontMatter', () => {
);
});

// Fix Yaml trying to auto-convert strings to numbers automatically
// Fix Yaml trying to convert strings to numbers automatically
// We only want to deal with a single type in the final frontmatter (not string | number)
test('should convert number values to string when string schema', () => {
const schema = Joi.object<{test: string}>({
test: JoiFrontMatter.string(),
Expand All @@ -46,7 +47,8 @@ describe('validateFrontMatter', () => {
expect(validateFrontMatter(frontMatter, schema)).toEqual({test: '42'});
});

// Helps to fix Yaml trying to auto-convert strings to dates automatically
// Helps to fix Yaml trying to convert strings to dates automatically
// We only want to deal with a single type in the final frontmatter (not string | Date)
test('should convert date values when string schema', () => {
const schema = Joi.object<{test: string}>({
test: JoiFrontMatter.string(),
Expand Down

0 comments on commit fbfa345

Please sign in to comment.