Skip to content

Commit e217ec4

Browse files
committed
chore: add some logs for e2e
1 parent 1b21043 commit e217ec4

File tree

7 files changed

+85
-22
lines changed

7 files changed

+85
-22
lines changed

e2e/cases/doctor-rspack/linter-rule-render.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { expect, test, chromium } from '@playwright/test';
2+
import * as core from '@actions/core';
23
import { getSDK, setSDK } from '@rsdoctor/core/plugins';
34
import { compileByRspack } from '@scripts/test-helper';
45
import { Compiler } from '@rspack/core';
@@ -121,17 +122,25 @@ test('linter rule render check', async () => {
121122

122123
// Navigate to a URL
123124
await page.goto(`file:///${reportPath}`);
125+
core.debug(`reportPath:: ${reportPath}`);
124126

125127
const ecmaVersionButton = await page.$('[data-node-key="E1004"]');
128+
core.debug(`ecmaVersionButton:: ${ecmaVersionButton}`);
129+
126130
await ecmaVersionButton?.click();
127131
// ignore output text check because there's no .map file for track the source code
128132
const source = await page.$('.e2e-ecma-source');
129133
const error = await page.$('.e2e-ecma-error');
130134

135+
core.debug(`source:: ${source}`);
136+
core.debug(`error:: ${error}`);
137+
131138
const sourceText = await source?.textContent();
132139
const errorText = await error?.textContent();
133140

134-
console.log('sourceText::::::::::::::', sourceText);
141+
core.debug(`sourceText:: ${sourceText}`);
142+
core.debug(`errorText:: ${errorText}`);
143+
135144
expect(sourceText).toBe(
136145
'/cases/doctor-rspack/dist/linter-rule-render/main.js:1:2',
137146
);

e2e/cases/doctor-rspack/plugin.test.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { expect, test } from '@playwright/test';
22
import { getSDK, setSDK } from '@rsdoctor/core/plugins';
33
import { compileByRspack } from '@scripts/test-helper';
4-
import { Compiler, RuleSetRule } from '@rspack/core';
4+
import { Compiler } from '@rspack/core';
5+
import * as core from '@actions/core';
56
import os from 'os';
67
import path from 'path';
78
import { createRsdoctorPlugin } from './test-utils';
@@ -11,10 +12,7 @@ let reportLoaderStartOrEndTimes = 0;
1112
async function rspackCompile(tapName: string, compile: typeof compileByRspack) {
1213
const file = path.resolve(__dirname, './fixtures/a.js');
1314
const loader = path.resolve(__dirname, './fixtures/loaders/comment.js');
14-
const esmLoader = path.resolve(
15-
__dirname,
16-
'./fixtures/loaders/esm-serialize-query-to-comment.mjs',
17-
);
15+
1816
const esmLoaderJs = path.resolve(
1917
__dirname,
2018
'./fixtures/loaders/esm/esm-serialize-query-to-comment.js',
@@ -157,6 +155,13 @@ test('rspack data store', async () => {
157155

158156
const ecmaCheckError = datas.errors.some((e) => e.code === 'E1004');
159157
expect(ecmaCheckError).toBeTruthy();
158+
159+
core.debug(`graphData.modules: ${graphData.modules}`);
160+
core.debug(`graphData.modules[0]: ${graphData.modules[0]}`);
161+
core.debug(
162+
`graphData.modules[0].webpackId: ${graphData.modules[0].webpackId}`,
163+
);
164+
160165
os.EOL === '\n'
161166
? expect(
162167
graphData.modules[0].webpackId.indexOf('/fixtures/a.js'),

e2e/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"lodash": "^4.17.21"
1212
},
1313
"devDependencies": {
14+
"@actions/core": "^1.11.1",
1415
"@playwright/test": "1.44.1",
1516
"@rsdoctor/cli": "workspace:*",
1617
"@rsdoctor/core": "workspace:*",

packages/ai/bin/rsdoctor-mcp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
import { runServer } from '../dist/server/server.cjs';
3+
import { runServer } from '../dist/index.cjs';
44

55

66
runServer().catch((error) => {

packages/ai/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
"@rslib/core": "^0.6.9",
2929
"@types/node": "^22.8.1",
3030
"typescript": "^5.2.2",
31-
"vitest": "3.0.9"
32-
},
33-
"dependencies": {
31+
"vitest": "3.0.9",
3432
"@rsdoctor/utils": "workspace:*",
3533
"@rsdoctor/types": "workspace:*",
3634
"socket.io-client": "4.6.1",

packages/ai/rslib.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default defineConfig({
55
{
66
source: {
77
entry: {
8-
index: './src/index.ts',
8+
index: './src/server/server.ts',
99
},
1010
tsconfigPath: './tsconfig.build.json',
1111
},

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)