Skip to content

Commit

Permalink
Add test that a yaml document is created when there is a comment #204
Browse files Browse the repository at this point in the history
it ensures that the schema is well-applied also on documents with only
the schema declaration

Signed-off-by: Aurélien Pupier <[email protected]>
  • Loading branch information
apupier committed Jul 22, 2020
1 parent a13c6e3 commit b3ae1c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ suite('Test parser', () => {
assert(parsedDocument.documents.length === 0, 'A document has been created for an empty text');
});

it('parse only comment', () => {
const parsedDocument = parse('# a comment');
assert(parsedDocument.documents.length === 1, 'No document has been created when there is a comment');
});

it('parse single document', () => {
const parsedDocument = parse('test');
assert(parsedDocument.documents.length === 1, `A single document should be available but there are ${parsedDocument.documents.length}`);
Expand Down

0 comments on commit b3ae1c5

Please sign in to comment.