Skip to content

Commit

Permalink
fix: mock swap api regex
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewlilley committed Aug 7, 2024
1 parent 697444a commit d4e4412
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions apps/web/test/helpers/swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,11 @@ export class SwapPage extends BaseActions {
}

async mockSwapApi(jsonFile: string) {
await this.page.route('https://api.sushi.com/swap/**/*', (route) => {
return route.fulfill({ path: jsonFile })
})
await this.page.route(
/^(https:\/\/api\.sushi\.com|https:\/\/staging\.sushi\.com|http:\/\/127\.0\.0\.1:4505)\/swap\/v\d\/\d+(.*)$/gm,
(route) => {
return route.fulfill({ path: jsonFile })
},
)
}
}

0 comments on commit d4e4412

Please sign in to comment.