Skip to content

Commit

Permalink
Merge pull request #154 from algorandfoundation/test-template-undersc…
Browse files Browse the repository at this point in the history
…ores

test: add test to ensure TMPL_ variables with multiple underscores work
  • Loading branch information
neilcampbell authored Oct 31, 2023
2 parents 709b48e + 7eca725 commit 91a1032
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/app-deploy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,21 @@ test('Strip comments remove comments without removing commands', async () => {
expect(result).toBe(tealCodeResult)
})

test('Can substitute template variable with multiple underscores', async () => {
const test_teal = `
int TMPL_SOME_VALUE
return
`
const test_params = {
SOME_VALUE: 123,
}
const substituted = algokit.performTemplateSubstitution(test_teal, test_params)
expect(substituted).toBe(`
int 123
return
`)
})

function getMetadata(overrides?: Partial<AppDeployMetadata>): AppDeployMetadata {
return {
name: 'test',
Expand Down

0 comments on commit 91a1032

Please sign in to comment.