Skip to content

Commit

Permalink
test: add a simple test for nunjucks globals
Browse files Browse the repository at this point in the history
  • Loading branch information
webketje committed Jul 18, 2023
1 parent 3a14b98 commit 3ff0075
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/globals/dependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions test/globals/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello, World!
1 change: 1 addition & 0 deletions test/globals/input.nunjucks
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ sayHello(name) }}
3 changes: 3 additions & 0 deletions test/globals/locals.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "World"
}
7 changes: 7 additions & 0 deletions test/globals/options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
globals: {
sayHello(name) {
return `Hello, ${name}!`
}
}
}

0 comments on commit 3ff0075

Please sign in to comment.