refactor: modify assertion for proxy
This commit is contained in:
parent
e8ef8bf8ef
commit
b6928faf44
@ -15,17 +15,13 @@ describe("VS Code Routes", ["--disable-workspace-trust"], {}, async () => {
|
|||||||
|
|
||||||
// Check there were no redirections
|
// Check there were no redirections
|
||||||
const url = new URL(codeServerPage.page.url())
|
const url = new URL(codeServerPage.page.url())
|
||||||
let expected = route
|
|
||||||
if (process.env.USE_PROXY === "1") {
|
if (process.env.USE_PROXY === "1") {
|
||||||
// TODO@jsjoeio if running behind proxy
|
// Behind proxy, path will be /<port/ide + route
|
||||||
// we need to modify expected value
|
const pathWithoutProxy = url.pathname.split("/ide")[1]
|
||||||
// instead of / it should be /<port>/ide
|
expect(pathWithoutProxy).toBe(route)
|
||||||
expected = "something else "
|
} else {
|
||||||
// could also modify left side and stripe /<port>/ide...
|
expect(url.pathname).toBe(route)
|
||||||
// in url.pathname
|
|
||||||
|
|
||||||
}
|
}
|
||||||
expect(url.pathname).toBe(expected)
|
|
||||||
|
|
||||||
// TODO@jsjoeio
|
// TODO@jsjoeio
|
||||||
// now that we are in a proper browser instead of scraping the HTML we
|
// now that we are in a proper browser instead of scraping the HTML we
|
||||||
|
Reference in New Issue
Block a user