', async t => {
const actual = `{{ optionFoo }}`;
const expected = ` Locals attribute: undefined Locals option: optionBar optionBar
`;
- const html = await posthtml().use(plugin({locals: {optionFoo: 'optionBar'}})).process(actual).then(result => clean(result.html));
+ const html = await posthtml().use(plugin({locals: {optionFoo: 'optionBar'}, expressions: {strictMode: false}})).process(actual).then(result => clean(result.html));
t.is(html, expected);
});
@@ -171,7 +171,7 @@ test('Must work with locals provided in options but no content passed', async t
const actual = ``;
const expected = ` Locals attribute: undefined Locals option: optionBar
`;
- const html = await posthtml().use(plugin({locals: {optionFoo: 'optionBar'}})).process(actual).then(result => clean(result.html));
+ const html = await posthtml().use(plugin({locals: {optionFoo: 'optionBar'}, expressions: {strictMode: false}})).process(actual).then(result => clean(result.html));
t.is(html, expected);
});
@@ -195,3 +195,12 @@ test('Must parse attribute as locals', async t => {
t.is(html, expected);
});
+
+test('Must use posthtml-expressions options', async t => {
+ const actual = ``;
+ const expected = `bar{{ ignored }}
`;
+
+ const html = await posthtml().use(plugin({expressions: {delimiters: ['%[', ']%']}})).process(actual).then(result => clean(result.html));
+
+ t.is(html, expected);
+});