Skip to content

Commit 25ba6d0

Browse files
committed
test: update test for custom directives
1 parent db31f89 commit 25ba6d0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/test.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ describe('PostHTML-Parser test', function() {
6666
expect(parser('<!doctype html>')).to.eql(['<!doctype html>']);
6767
});
6868

69+
it('should be parse directive', function() {
70+
var customDirectives = {directives: [
71+
{name: '?php', start: '<', end: '>'}
72+
]};
73+
74+
expect(parser('<?php echo "Hello word"; ?>', customDirectives)).to.eql(['<?php echo "Hello word"; ?>']);
75+
});
76+
6977
it('should be parse tag', function() {
7078
expect(parser('<html></html>')).to.eql([{ tag: 'html' }]);
7179
});
@@ -105,10 +113,4 @@ describe('PostHTML-Parser test', function() {
105113
{ tag: 'mySuperTag' }
106114
]);
107115
});
108-
109-
it('should be parse directive', function() {
110-
expect(parser('<?php echo "Hello word"; ?>')).to.eql([
111-
{ type: 'directive', content: ['?php echo "Hello word"; ?']
112-
}]);
113-
});
114116
});

0 commit comments

Comments
 (0)