Skip to content

Commit

Permalink
fix: use regexp as replaceAll doesn't available
Browse files Browse the repository at this point in the history
  • Loading branch information
ihexxa committed Dec 17, 2024
1 parent 88744bb commit 790d51a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/insomnia/src/hidden-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ window.bridge.onmessage(async (data, callback) => {

// as insomnia.test accepts an async function, prepend await to it as user don't write it
function translateTestHandlers(script: string): string {
const replacedTests = script.replace('insomnia.test(', 'await insomnia.test(');
return replacedTests.replace('insomnia.test.skip(', 'await insomnia.test.skip(');
const replacedTests = script.replace(/insomnia\.test\(/g, 'await insomnia.test(');
return replacedTests.replace(/insomnia\.test\.skip\(/g, 'await insomnia.test.skip(');
}

// This function is duplicated in scriptExecutor.ts to run in nodejs
Expand Down

0 comments on commit 790d51a

Please sign in to comment.