Add a jinja2 template to the njk test path

Signed-off-by: Axel Hecht <axel@pike.org>
This commit is contained in:
Axel Hecht
2021-08-16 18:45:13 +02:00
parent 7dd86e5233
commit 8fb45d6e37
@@ -338,6 +338,8 @@ describe('fetch:template', () => {
'empty-dir-${{ values.count }}': {},
'static.txt': 'static content',
'${{ values.name }}.txt': 'static content',
'${{ values.name }}.txt.jinja2':
'${{ values.name }}: ${{ values.count }}',
subdir: {
'templated-content.txt.njk':
'${{ values.name }}: ${{ values.count }}',
@@ -365,6 +367,12 @@ describe('fetch:template', () => {
).resolves.toEqual('static content');
});
it('copies jinja2 files with templated names successfully', async () => {
await expect(
fs.readFile(`${workspacePath}/target/test-project.txt.jinja2`, 'utf-8'),
).resolves.toEqual('${{ values.name }}: ${{ values.count }}');
});
it('copies files with templated content successfully', async () => {
await expect(
fs.readFile(