Skip to content

Commit 27b90d9

Browse files
committed
test: add failing e2e case
1 parent dc7ec83 commit 27b90d9

File tree

9 files changed

+92
-18
lines changed

9 files changed

+92
-18
lines changed

e2e/fixtures/symlink/doc/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[internal](./internal)

e2e/fixtures/symlink/doc/internal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../outside
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# whatever
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[content](./content.mdx)

e2e/fixtures/symlink/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "@rspress-fixture/rspress-symlink",
3+
"version": "1.0.0",
4+
"private": true,
5+
"scripts": {
6+
"build": "rspress build",
7+
"dev": "rspress dev",
8+
"preview": "rspress preview"
9+
},
10+
"dependencies": {
11+
"rspress": "workspace:*"
12+
},
13+
"devDependencies": {
14+
"@types/node": "^18.11.17"
15+
}
16+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as path from 'node:path';
2+
import { defineConfig } from 'rspress/config';
3+
4+
export default defineConfig({
5+
root: path.join(__dirname, 'doc'),
6+
markdown: {
7+
mdxRs: false,
8+
},
9+
ssg: {
10+
fallback: false,
11+
},
12+
});

e2e/tests/symlink.test.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import path from 'node:path';
2+
import { expect, test } from '@playwright/test';
3+
import { getPort, killProcess, runDevCommand } from '../utils/runCommands';
4+
5+
const fixtureDir = path.resolve(__dirname, '../fixtures');
6+
7+
test.describe('symlink test', async () => {
8+
let appPort;
9+
let app;
10+
test.beforeAll(async () => {
11+
const appDir = path.join(fixtureDir, 'symlink');
12+
appPort = await getPort();
13+
app = await runDevCommand(appDir, appPort);
14+
});
15+
16+
test.afterAll(async () => {
17+
if (app) {
18+
await killProcess(app);
19+
}
20+
});
21+
22+
test('Internal Index page', async ({ page }) => {
23+
await page.goto(`http://localhost:${appPort}/internal.html`);
24+
const anchors = await page.$$('.rspress-doc a');
25+
const hrefList = await page.evaluate(
26+
anchors => anchors.map(anchor => (anchor as HTMLAnchorElement).href),
27+
anchors,
28+
);
29+
expect(hrefList).toEqual([
30+
`http://localhost:${appPort}/internal/content.html`,
31+
]);
32+
});
33+
});

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"rsbuild-plugin-virtual-module": "0.1.1",
108108
"tailwindcss": "^3.4.17",
109109
"typescript": "^5.8.2",
110-
"vfile": "^5.3.7"
110+
"vfile": "^6.0.3"
111111
},
112112
"engines": {
113113
"node": ">=14.17.6"

pnpm-lock.yaml

Lines changed: 26 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy