Skip to content

Commit 18b62b4

Browse files
[Backport 7.x] Fix integration test (#1336)
Co-authored-by: Tomas Della Vedova <[email protected]>
1 parent dd8ee90 commit 18b62b4

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

test/integration/test-runner.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -279,20 +279,26 @@ function build (opts = {}) {
279279
// eg: 'Basic ${auth}' we search the stahed value 'auth'
280280
// and the resulting value will be 'Basic valueOfAuth'
281281
if (typeof val === 'string' && val.includes('${')) {
282-
const start = val.indexOf('${')
283-
const end = val.indexOf('}', val.indexOf('${'))
284-
const stashedKey = val.slice(start + 2, end)
285-
const stashed = stash.get(stashedKey)
286-
obj[key] = val.slice(0, start) + stashed + val.slice(end + 1)
282+
while (obj[key].includes('${')) {
283+
const val = obj[key]
284+
const start = val.indexOf('${')
285+
const end = val.indexOf('}', val.indexOf('${'))
286+
const stashedKey = val.slice(start + 2, end)
287+
const stashed = stash.get(stashedKey)
288+
obj[key] = val.slice(0, start) + stashed + val.slice(end + 1)
289+
}
287290
continue
288291
}
289292
// handle json strings, eg: '{"hello":"$world"}'
290293
if (typeof val === 'string' && val.includes('"$')) {
291-
const start = val.indexOf('"$')
292-
const end = val.indexOf('"', start + 1)
293-
const stashedKey = val.slice(start + 2, end)
294-
const stashed = '"' + stash.get(stashedKey) + '"'
295-
obj[key] = val.slice(0, start) + stashed + val.slice(end + 1)
294+
while (obj[key].includes('"$')) {
295+
const val = obj[key]
296+
const start = val.indexOf('"$')
297+
const end = val.indexOf('"', start + 1)
298+
const stashedKey = val.slice(start + 2, end)
299+
const stashed = '"' + stash.get(stashedKey) + '"'
300+
obj[key] = val.slice(0, start) + stashed + val.slice(end + 1)
301+
}
296302
continue
297303
}
298304
// if the key value is a string, and the string includes '$'

0 commit comments

Comments
 (0)