Skip to content

Commit 1fecbdc

Browse files
committed
test: options directives, issue #97
1 parent 99c0281 commit 1fecbdc

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

test/expect/directives.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php echo $myVar; ?>

test/fixtures/directives.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php echo $myVar; ?>

test/test-core.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ const expect = (file) => {
1515
return readSync(join(__dirname, 'expect', `${file}.html`), 'utf8')
1616
}
1717

18-
function process (t, name, options, log = false, plugins = [expressions(options)]) {
18+
function process (t, name, options, log = false, plugins = [expressions(options)], processOptions = {}) {
1919
return posthtml(plugins)
20-
.process(fixture(name))
20+
.process(fixture(name), processOptions)
2121
.then((result) => {
2222
log && console.log(result.html)
2323

@@ -89,3 +89,13 @@ test('Raw output - custom tag', (t) => {
8989
test('Boolean attribute', (t) => {
9090
return process(t, 'boolean_attr', null, false, [beautify(), expressions()])
9191
})
92+
93+
test('Directives options', (t) => {
94+
return process(t, 'directives', null, false, [expressions()], {
95+
directives: [{
96+
name: '?php',
97+
start: '<',
98+
end: '>',
99+
}]
100+
})
101+
})

0 commit comments

Comments
 (0)