Skip to content

Commit 602599d

Browse files
committed
test: add test for override locals defined globally
1 parent 06a8653 commit 602599d

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div>Should override global locals</div>
2+
<div>local</div>
3+
<div>local</div>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div>Should override global locals</div>
2+
<div>local</div>
3+
<div>local</div>

test/test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ test('Should merge global locals', t => {
6060
}})
6161
})
6262

63+
test('Should override global locals', t => {
64+
return process(t, 'override-global-variables', {
65+
posthtmlExpressionsOptions: {
66+
locals: {globalVariable: 'global'}
67+
}})
68+
})
69+
6370
test('Should merge global variables and evaluate each local variable', t => {
6471
return process(t, 'multiple-include', {
6572
posthtmlExpressionsOptions: {

0 commit comments

Comments
 (0)