Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b6928fa

Browse files
committedDec 21, 2022
refactor: modify assertion for proxy
1 parent e8ef8bf commit b6928fa

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed
 

‎test/e2e/routes.test.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,13 @@ describe("VS Code Routes", ["--disable-workspace-trust"], {}, async () => {
1515

1616
// Check there were no redirections
1717
const url = new URL(codeServerPage.page.url())
18-
let expected = route
1918
if (process.env.USE_PROXY === "1") {
20-
// TODO@jsjoeio if running behind proxy
21-
// we need to modify expected value
22-
// instead of / it should be /<port>/ide
23-
expected = "something else "
24-
// could also modify left side and stripe /<port>/ide...
25-
// in url.pathname
26-
19+
// Behind proxy, path will be /<port/ide + route
20+
const pathWithoutProxy = url.pathname.split("/ide")[1]
21+
expect(pathWithoutProxy).toBe(route)
22+
} else {
23+
expect(url.pathname).toBe(route)
2724
}
28-
expect(url.pathname).toBe(expected)
2925

3026
// TODO@jsjoeio
3127
// now that we are in a proper browser instead of scraping the HTML we

0 commit comments

Comments
 (0)
Please sign in to comment.