mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-13 08:15:14 +02:00
test: use docs base path
This commit is contained in:
parent
05f6430025
commit
d4cbd4206b
1 changed files with 7 additions and 4 deletions
|
|
@ -9,6 +9,7 @@ import { setTimeout as delay } from "node:timers/promises";
|
|||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const configuredDocsSiteUrl = process.env.DOCS_SITE_URL;
|
||||
const docsBasePath = "/ktx";
|
||||
let docsSiteUrl = configuredDocsSiteUrl;
|
||||
let docsServer;
|
||||
let docsServerOutput = "";
|
||||
|
|
@ -46,7 +47,7 @@ async function waitForDocsServer() {
|
|||
}
|
||||
|
||||
try {
|
||||
await fetch(`${docsSiteUrl}/docs`, { redirect: "manual" });
|
||||
await fetch(`${docsSiteUrl}${docsBasePath}/docs`, { redirect: "manual" });
|
||||
return;
|
||||
} catch {
|
||||
await delay(200);
|
||||
|
|
@ -99,12 +100,14 @@ after(async () => {
|
|||
}
|
||||
});
|
||||
|
||||
test("/docs redirects to the docs introduction", async () => {
|
||||
const response = await fetch(`${docsSiteUrl}/docs`, { redirect: "manual" });
|
||||
test("/ktx/docs redirects to the docs introduction", async () => {
|
||||
const response = await fetch(`${docsSiteUrl}${docsBasePath}/docs`, {
|
||||
redirect: "manual",
|
||||
});
|
||||
|
||||
assert.equal(response.status, 307);
|
||||
assert.equal(
|
||||
response.headers.get("location"),
|
||||
"/docs/getting-started/introduction",
|
||||
`${docsBasePath}/docs/getting-started/introduction`,
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue