mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 19:03:38 +02:00
test: add test for readOutputHTMLFile (#6506)
This commit is contained in:
parent
8bdecf107c
commit
58e07a6796
7 changed files with 87 additions and 215 deletions
|
@ -223,7 +223,10 @@ export async function readOutputHTMLFile(
|
|||
trailingSlash: boolean | undefined,
|
||||
): Promise<Buffer> {
|
||||
const withTrailingSlashPath = path.join(outDir, permalink, 'index.html');
|
||||
const withoutTrailingSlashPath = path.join(outDir, `${permalink}.html`);
|
||||
const withoutTrailingSlashPath = path.join(
|
||||
outDir,
|
||||
`${permalink.replace(/\/$/, '')}.html`,
|
||||
);
|
||||
if (trailingSlash) {
|
||||
return fs.readFile(withTrailingSlashPath);
|
||||
} else if (trailingSlash === false) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue