Skip to content

Commit

Permalink
test(yaml-timestamp): Add tests for config keys
Browse files Browse the repository at this point in the history
  • Loading branch information
JeppeKlitgaard committed Oct 12, 2021
1 parent 55138e5 commit f18907f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,20 @@ describe('yaml timestamp', () => {
date created: 2019-01-01
---
`;
expect(rulesDict['yaml-timestamp'].apply(before, {'Date Created': true})).toBe(after);
expect(rulesDict['yaml-timestamp'].apply(before, {'Date Created': true, 'Date Created Key': 'date created'})).toBe(after);
});
it('Respects created and modified key', () => {
const before = dedent`
---
created: 2019-01-01
---
`;
const after = dedent`
---
created: 2019-01-01
---
`;
expect(rulesDict['yaml-timestamp'].apply(before, {'Date Created': true, 'Date Created Key': 'created'})).toBe(after);
});
});
describe('Insert yaml attributes', () => {
Expand Down

0 comments on commit f18907f

Please sign in to comment.