Skip to content

Commit f11d1fb

Browse files
Jeroen Langeveldtaniki
authored andcommitted
test: Clone comments tests
1 parent c0c22a0 commit f11d1fb

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

tests/frontmatter/comments.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { compareFiles } from 'tests/common';
2+
import { describe, expect, it } from 'vitest';
3+
4+
describe('Comments', () => {
5+
it('should handle comments', () => {
6+
const { actual, expected } = compareFiles(__dirname, {
7+
formatOptions: { pugCommentPreserveSpaces: 'trim-all' },
8+
});
9+
expect(actual).toBe(expected);
10+
});
11+
});

tests/frontmatter/formatted.pug

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// just some paragraphs
2+
p foo
3+
p bar
4+
//- will not output within markup
5+
p foo
6+
p bar
7+
div
8+
//-
9+
Comments for your template writers.
10+
Use as much text as you want.
11+
//
12+
Comments for your HTML readers.
13+
Use as much text as you want.
14+
div
15+
//- Indented comment
16+
span Test
17+
// Indented comment
18+
span Test
19+
20+
//- Indented comment
21+
span Test

tests/frontmatter/unformatted.pug

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// just some paragraphs
2+
p foo
3+
p bar
4+
//- will not output within markup
5+
p foo
6+
p bar
7+
div
8+
//-
9+
Comments for your template writers.
10+
Use as much text as you want.
11+
//
12+
Comments for your HTML readers.
13+
Use as much text as you want.
14+
div
15+
//- Indented comment
16+
span Test
17+
// Indented comment
18+
span Test
19+
20+
21+
22+
//- Indented comment
23+
span Test

0 commit comments

Comments
 (0)