-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
chore: change line width to 120 #5530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 103 files out of 210 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the WalkthroughRepository-wide formatting compacted to single-line style and printWidth set to 120. Two behavioral adjustments: background task errors now emit via app in Context._runInBackground, and HttpClient.request assigns tracer with a new fallback chain (ctx.tracer → options.tracer → app.tracer). Tests largely reformatted; httpclient tests significantly expanded. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Ctx as Context
participant BG as Background Task (async)
participant App as Application
User->>Ctx: runInBackground(fn)
Ctx->>BG: _runInBackground(fn)
rect rgba(200,230,255,0.2)
note right of BG: Execute fn(ctx)
BG-->>BG: await fn(ctx)
end
BG-->>Ctx: resolved
alt task throws
BG--x Ctx: throw err
Ctx->>App: emit('error', err, ctx)
end
sequenceDiagram
autonumber
participant Caller
participant HC as HttpClient
participant App as Application
participant S as Remote Server
Caller->>HC: request(url, options{ ctx?, tracer? })
note over HC: Resolve tracer:<br/>options.ctx?.tracer<br/>|| options.tracer<br/>|| app.tracer
HC->>S: HTTP request (with tracer headers)
S-->>HC: Response
HC-->>Caller: HttpClientResponse
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR changes the line width configuration for code formatting from the default (typically 80 characters) to 120 characters. The change affects code formatting across multiple TypeScript test files and configuration files in the EggJS framework.
Key Changes
- Updated
.prettierrcto setprintWidth: 120 - Reformatted long lines across numerous test files to fit within the 120-character limit
- Consolidated multi-line function calls, imports, and expressions into single lines where possible
Reviewed Changes
Copilot reviewed 91 out of 91 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .prettierrc | Added printWidth: 120 configuration |
| packages/egg/vitest.config.ts | Consolidated exclude array to single line |
| packages/egg/test/utils.ts | Reformatted imports and function signatures |
| Multiple test files | Consolidated method chains, imports, and function calls |
| Multiple fixture files | Reformatted template strings and configuration objects |
| Source files | Reformatted imports, function signatures, and expressions |
Summary of ChangesHello @fengmk2, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on a significant code style update, specifically adjusting the maximum line length to 120 characters across the codebase. This change, driven by a Prettier configuration update, aims to improve code readability and consistency by re-wrapping longer lines in various files. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request updates the Prettier configuration to set the printWidth to 120. The subsequent changes across the codebase are purely stylistic, reflowing code to fit the new line width. The changes are consistent and correct according to the new formatting rule. The review did not find any functional issues or bugs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (26)
packages/egg/test/fixtures/apps/multipart/app/controller/upload.js (1)
25-30: Optional: await stream completion to avoid race in testsCurrently responds before the file is fully written. To reduce flakiness, await the write completion.
Apply this diff:
- const ws = fs.createWriteStream(path.join(this.app.config.logger.dir, 'multipart-test-file')); - filePart.pipe(ws); + const ws = fs.createWriteStream(path.join(this.app.config.logger.dir, 'multipart-test-file')); + await new Promise((resolve, reject) => { + filePart.on('error', reject); + ws.on('error', reject); + ws.on('finish', resolve); + filePart.pipe(ws); + });packages/egg/test/fixtures/custom-egg/index.js (1)
4-4: Optional clarity: alias base class before extendingMinor readability: alias
module.exports.Applicationbefore reassigning to make intent explicit.const BaseApp = module.exports.Application; module.exports.Application = class Application extends BaseApp { // ... }packages/egg/test/app/middleware/site_file.test.ts (2)
117-117: Make assertion style consistent with the rest of the fileUse assert.equal (or assert.strictEqual) instead of a boolean assertion for consistency and clearer diffs on failure.
Apply this diff:
- assert(res.headers.location === 'https://eggjs.org/function/favicon.ico'); + assert.equal(res.headers.location, 'https://eggjs.org/function/favicon.ico');
134-134: Prefer assert.match for header directivesThis gives a clearer failure message and avoids false positives.
Apply this diff:
- .expect(res => assert(res.headers['cache-control'].includes('no-store'))) + .expect(res => assert.match(res.headers['cache-control'], /\bno-store\b/))packages/egg/test/cluster1/app_worker.test.ts (2)
84-84: Avoid log assertion race; add a tiny wait before app.expectLog flush to stdout can lag the request completion; add a short await to reduce flakiness.
Apply this diff:
- await assert.rejects(async () => { - await app.httpRequest().get('/timeout'); - }, /socket hang up/); - app.expect('stdout', /\[http_server] A request `GET \/timeout` timeout with client/); + await assert.rejects(async () => { + await app.httpRequest().get('/timeout'); + }, /socket hang up/); + // Give logger a moment to flush to stdout to avoid flakiness + await scheduler.wait(50); + app.expect('stdout', /\[http_server] A request `GET \/timeout` timeout with client/);
98-100: Tighten Node version parsing and condition readabilityUse process.versions.node and explicit majors/minors; simplifies the predicate.
Apply this diff:
- const version = process.version.split('.').map(a => parseInt(a.replace('v', ''))); + const [ versionMajor, versionMinor ] = process.versions.node.split('.').map(n => Number(n)); @@ - if ((version[0] === 8 && version[1] >= 10) || (version[0] === 9 && version[1] >= 4) || version[0] > 9) { + if ((versionMajor === 8 && versionMinor >= 10) || (versionMajor === 9 && versionMinor >= 4) || versionMajor >= 10) {packages/egg/test/lib/core/logger.test.ts (2)
161-161: Optional: assert JSON log structurally for robustness.Parsing the last log line guards against formatting variance and avoids brittle substring checks.
- assert(fs.readFileSync(logfile, 'utf8').includes('"message":"json format"')); + const last = fs.readFileSync(logfile, 'utf8').trim().split('\n').pop()!; + try { + const record = JSON.parse(last); + assert.equal(record.message, 'json format'); + } catch { + // Fallback if the line isn't pure JSON + assert(last.includes('"message":"json format"')); + }Also applies to: 167-167
261-261: Optional: relax regex to avoid hardcoding the IP.Makes the assertion resilient if the remote address differs.
- app.expectLog(/ INFO \d+ \[-\/127\.0\.0\.1\/[\d.]+ms GET \/] enableFastContextLogger: true/); + app.expectLog(/ INFO \d+ \[\-\/[^/]+\/[\d.]+ms GET \/] enableFastContextLogger: true/);packages/egg/test/fixtures/apps/app-ts-type-check/normal.ts (1)
200-200: Optional: prefer template literals for readability.
Concise and easier to scan.Apply this diff:
- formatter: (meta: any) => meta.date + ' ' + meta.level + ' ' + meta.pid + ' ' + meta.message, + formatter: (meta: any) => `${meta.date} ${meta.level} ${meta.pid} ${meta.message}`,packages/egg/src/app/middleware/meta.ts (1)
22-22: Optional: emit x-readtime as a fixed-precision string.
For consistent header formatting, consider stringifying to 3 decimals.Apply this diff if you prefer stable formatting:
- ctx.set('x-readtime', Math.floor((performance.now() - ctx.performanceStarttime) * 1000) / 1000); + const readtime = Math.floor((performance.now() - ctx.performanceStarttime) * 1000) / 1000; + ctx.set('x-readtime', readtime.toFixed(3));packages/egg/test/fixtures/apps/subdir-services/app/controller/home.js (1)
11-11: Suspicious self-compare (always true).
this.service.certifyPersonal === this.service.certifyPersonal is tautological in fixtures; rg shows the expression in:
- packages/egg/test/fixtures/apps/subdir-services/app/controller/home.js:11
- packages/core/test/fixtures/subdir-services/app/controller/home.js:11
Tests expect serviceIsSame: true at:- packages/core/test/loader/mixin/load_service.test.ts:144
- packages/egg/test/lib/core/loader/load_service.test.ts:95
Apply one of the following:
Option A (compare across accessors):
- serviceIsSame: this.service.certifyPersonal === this.service.certifyPersonal, + serviceIsSame: this.service.certifyPersonal === this.ctx.service.certifyPersonal,Option B (keep as-is but silence linter explicitly, if intentional):
- serviceIsSame: this.service.certifyPersonal === this.service.certifyPersonal, + /* biome-ignore lint/suspicious/noSelfCompare: intentional identity check in fixture */ + serviceIsSame: this.service.certifyPersonal === this.service.certifyPersonal,Option C (remove if unused):
- serviceIsSame: this.service.certifyPersonal === this.service.certifyPersonal,packages/egg/test/lib/core/context_performance_starttime.test.ts (1)
17-17: Remove redundant assertionLine 17 duplicates the prior type and truthy checks. Trim to keep tests lean.
- assert(typeof ctx.performanceStarttime === 'number' && ctx.performanceStarttime > 0);packages/egg/src/app/extend/helper.ts (1)
43-43: Replace deprecated url.resolve with WHATWG URLUse URL(base, relative) to avoid deprecated node:url.resolve and edge cases. Behavior stays the same.
- return this.ctx.protocol + '://' + this.ctx.host + url.resolve('/', this.pathFor(name, params)); + return new URL(this.pathFor(name, params), `${this.ctx.protocol}://${this.ctx.host}`).toString();Also remove the now-unused import:
-import url from 'node:url';packages/egg/test/fixtures/apps/helper/app/router.js (1)
19-19: Optional: prefer strict equality in fixtures
===over==avoids accidental coercion, even for strings. Not required for this PR.- this.body = this.helper.shtml('<a href="/">xx</a><h1>a</h1>') == '<a href="/">xx</a><h1>a</h1>'; + this.body = this.helper.shtml('<a href="/">xx</a><h1>a</h1>') === '<a href="/">xx</a><h1>a</h1>';Also applies to: 24-24, 28-28, 32-32
packages/egg/test/lib/plugins/development.test.ts (1)
7-7: Normalize utils import extension for consistencyOther tests use '../../utils.js'. Consider aligning this to avoid mixed .ts/.js specifiers.
Apply:
-import { type MockApplication, createApp, cluster, getFilepath } from '../../utils.ts'; +import { type MockApplication, createApp, cluster, getFilepath } from '../../utils.js';packages/egg/src/lib/egg.ts (1)
546-546: Fix grammar in startup-timeout error logUse “is still not ready” for clarity.
Apply this diff:
- this.coreLogger.error(`${this.type} still doesn't ready after ${this.config.workerStartTimeout} ms.`); + this.coreLogger.error(`${this.type} is still not ready after ${this.config.workerStartTimeout} ms.`);packages/egg/src/lib/core/messenger/local.ts (1)
112-124: Avoid mutating thetoparameter (clarity)Small readability tweak: derive a local
targetinstead of reassigning the parameter.- if (!to) { - to = egg.type === 'application' ? 'agent' : 'application'; - } + const target = to ?? (egg.type === 'application' ? 'agent' : 'application'); - if (application && application.messenger && (to === 'application' || to === 'both')) { + if (application && application.messenger && (target === 'application' || target === 'both')) { application.messenger.onMessage({ action, data }); } - if (agent && agent.messenger && (to === 'agent' || to === 'both')) { + if (agent && agent.messenger && (target === 'agent' || target === 'both')) { agent.messenger.onMessage({ action, data }); } - if (opposite && opposite.messenger && to === 'opposite') { + if (opposite && opposite.messenger && target === 'opposite') { opposite.messenger.onMessage({ action, data }); }packages/egg/test/app/extend/context.test.ts (3)
230-243: Prefer relying on backgroundTasksFinished over extra waitsGiven you already await app.backgroundTasksFinished(), the additional scheduler.wait(100) may be unnecessary and can introduce flakiness.
- await scheduler.wait(100); + // usually unnecessary when backgroundTasksFinished() resolves + // await scheduler.wait(100);
273-281: Rename lgoDir → logDir for consistencyMinor typo; align with other blocks using logDir.
- const lgoDir = app.config.logger.dir; - const log = fs.readFileSync(path.join(lgoDir, 'common-error.log'), 'utf8'); + const logDir = app.config.logger.dir; + const log = fs.readFileSync(path.join(logDir, 'common-error.log'), 'utf8'); assert(/ENOENT: no such file or directory/.test(log)); assert( /\[egg:background] task:mockError fail \([\d.]+ms\)/.test( - fs.readFileSync(path.join(lgoDir, 'egg-web.log'), 'utf8') + fs.readFileSync(path.join(logDir, 'egg-web.log'), 'utf8') ) );
422-422: Avoid relying on property order in object keys (test robustness)Ordering of Object.keys can be brittle; consider asserting set inclusion instead.
- assert.deepEqual(Object.keys(context.state), ['__', 'gettext', 'a', 'b', 'c']); + assert.deepEqual(new Set(Object.keys(context.state)), new Set(['__', 'gettext', 'a', 'b', 'c']));packages/egg/src/app/extend/context.ts (1)
245-249: Consider log level for failureThe failure line currently uses coreLogger.info; warn or error may be more appropriate for failures.
- this.coreLogger.info('[egg:background] task:%s fail (%dms)', taskName, diff(startTime)); + this.coreLogger.warn('[egg:background] task:%s fail (%dms)', taskName, diff(startTime));packages/egg/test/lib/core/httpclient.test.ts (1)
642-676: Deduplicate identical retry tests or vary the code pathTwo tests named "should retry when httpclient fail" are functionally identical. Consider converting one to use request() or assert different aspects (e.g., x-retry header) to avoid redundancy.
- it('should retry when httpclient fail', async () => { + it('should retry when httpclient fail via request()', async () => { let hasRetry = false; - const res = await app.httpclient.curl(`${url}/retry`, { + const res = await app.httpclient.request(`${url}/retry`, { retry: 1, retryDelay: 100, isRetry(res) { const shouldRetry = res.status >= 500; if (shouldRetry) { hasRetry = true; } return shouldRetry; }, }); assert(hasRetry); assert(res.status === 200); });packages/egg/test/lib/core/loader/load_plugin.test.ts (2)
151-152: Make the warning assertion less brittleExact string equality will flake if prefix/suffix formatting changes. Prefer a regex or substring match.
Apply this diff:
- assert(message === '[@eggjs/core/egg_loader] pluginName(e) is different from pluginConfigName(wrong-name)'); + assert.match( + String(message), + /pluginName\(e\) is different from pluginConfigName\(wrong-name\)/ + );
232-237: Align with guideline: prefer Node.js assert over Vitest expect in testsCoding guidelines for packages//test//*.test.ts say to use Node’s assert for assertions. Consider replacing the snapshot
expect(...).toMatchSnapshot()with an explicitassert.deepEqualto a stable expected list (or justify the snapshot as an exception).If you want, I can help derive the current expected plugin order and generate the assert block to replace the snapshot.
packages/egg/test/egg.test.ts (2)
169-183: Consider replacing assert-file with built-in assert + fs for consistencyRepo guidelines prefer Node’s built-in assert; you can replace assert-file usages here with fs + assert while keeping behavior identical.
Apply:
- assertFile(path.join(baseDir, `run/application_timing_${process.pid}.json`)); - assertFile( - path.join(baseDir, 'logs/dumptiming-timeout/common-error.log'), - /unfinished timing item: {"name":"Did Load in app.js:didLoad"/ - ); + assert.ok(fs.existsSync(path.join(baseDir, `run/application_timing_${process.pid}.json`))); + { + const p = path.join(baseDir, 'logs/dumptiming-timeout/common-error.log'); + const body = fs.readFileSync(p, 'utf8'); + assert.match(body, /unfinished timing item: {"name":"Did Load in app\.js:didLoad"/); + }
185-196: Same suggestion: avoid assert-file in favor of assert + fsKeeps assertions within Node’s built-in module.
Apply:
- assertFile( - path.join(baseDir, 'logs/dumptiming-slowBootActionMinDuration/egg-web.log'), - /\[slow-boot-action] #\d+ \d+ms, name: Did Load in app\.js:didLoad/ - ); + { + const p = path.join(baseDir, 'logs/dumptiming-slowBootActionMinDuration/egg-web.log'); + const body = fs.readFileSync(p, 'utf8'); + assert.match(body, /\[slow-boot-action] #\d+ \d+ms, name: Did Load in app\.js:didLoad/); + }Note: Similarly, later uses (e.g., assertFile.fail in Lines 305–308) can be migrated to assert.ok(!fs.existsSync(...)).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (91)
.prettierrc(1 hunks)packages/egg/src/app/extend/context.ts(6 hunks)packages/egg/src/app/extend/helper.ts(1 hunks)packages/egg/src/app/extend/request.ts(2 hunks)packages/egg/src/app/middleware/meta.ts(1 hunks)packages/egg/src/config/config.default.ts(2 hunks)packages/egg/src/index.ts(2 hunks)packages/egg/src/lib/agent.ts(1 hunks)packages/egg/src/lib/application.ts(6 hunks)packages/egg/src/lib/core/base_hook_class.ts(1 hunks)packages/egg/src/lib/core/context_httpclient.ts(2 hunks)packages/egg/src/lib/core/httpclient.ts(2 hunks)packages/egg/src/lib/core/logger.ts(3 hunks)packages/egg/src/lib/core/messenger/base.ts(2 hunks)packages/egg/src/lib/core/messenger/index.ts(1 hunks)packages/egg/src/lib/core/messenger/ipc.ts(6 hunks)packages/egg/src/lib/core/messenger/local.ts(7 hunks)packages/egg/src/lib/core/utils.ts(1 hunks)packages/egg/src/lib/egg.ts(14 hunks)packages/egg/src/lib/types.ts(2 hunks)packages/egg/test/agent.test.ts(5 hunks)packages/egg/test/app/extend/application.test.ts(4 hunks)packages/egg/test/app/extend/context.jsonp.test.ts(1 hunks)packages/egg/test/app/extend/context.test.ts(11 hunks)packages/egg/test/app/extend/helper.test.ts(2 hunks)packages/egg/test/app/extend/request.test.ts(3 hunks)packages/egg/test/app/extend/response.test.ts(3 hunks)packages/egg/test/app/middleware/body_parser.test.ts(3 hunks)packages/egg/test/app/middleware/meta.test.ts(2 hunks)packages/egg/test/app/middleware/notfound.test.ts(2 hunks)packages/egg/test/app/middleware/override_method.test.ts(1 hunks)packages/egg/test/app/middleware/site_file.test.ts(3 hunks)packages/egg/test/application.test.ts(5 hunks)packages/egg/test/asyncSupport.test.ts(1 hunks)packages/egg/test/cluster1/app_worker.test.ts(4 hunks)packages/egg/test/cluster1/cluster-client-error.test.ts(1 hunks)packages/egg/test/cluster1/cluster-client.test.ts(4 hunks)packages/egg/test/cluster1/master.test.ts(1 hunks)packages/egg/test/cluster2/master.test.ts(1 hunks)packages/egg/test/egg.test.ts(13 hunks)packages/egg/test/fixtures/apps/app-enableFastContextLogger/app/controller/home.js(1 hunks)packages/egg/test/fixtures/apps/app-ts-type-check/error.ts(1 hunks)packages/egg/test/fixtures/apps/app-ts-type-check/normal.ts(1 hunks)packages/egg/test/fixtures/apps/app-ts/app/router.ts(1 hunks)packages/egg/test/fixtures/apps/ctx-background/app/controller/app.js(1 hunks)packages/egg/test/fixtures/apps/ctx-background/app/controller/home.js(1 hunks)packages/egg/test/fixtures/apps/helper/app/router.js(1 hunks)packages/egg/test/fixtures/apps/httpclient-next-overwrite/app.js(1 hunks)packages/egg/test/fixtures/apps/httpclient-overwrite/app.js(1 hunks)packages/egg/test/fixtures/apps/i18n/app/controller/message.js(1 hunks)packages/egg/test/fixtures/apps/messenger-broadcast/agent.js(1 hunks)packages/egg/test/fixtures/apps/messenger-broadcast/app.js(1 hunks)packages/egg/test/fixtures/apps/messenger-random/app.js(1 hunks)packages/egg/test/fixtures/apps/middlewares/config/config.default.js(1 hunks)packages/egg/test/fixtures/apps/multipart/app/controller/upload.js(1 hunks)packages/egg/test/fixtures/apps/multipart/app/view/home.html(1 hunks)packages/egg/test/fixtures/apps/multiple-view-engine/app/controller/view.js(1 hunks)packages/egg/test/fixtures/apps/multiple-view-engine/app/router.js(1 hunks)packages/egg/test/fixtures/apps/multiple-view-engine/config/config.default.js(1 hunks)packages/egg/test/fixtures/apps/subdir-services/app/controller/home.js(1 hunks)packages/egg/test/fixtures/apps/tracer-demo/tracer.js(1 hunks)packages/egg/test/fixtures/apps/view-render/app/view/index.html(1 hunks)packages/egg/test/fixtures/apps/view-render/app/view/inject.html(1 hunks)packages/egg/test/fixtures/apps/view-render/app/view/locals.html(1 hunks)packages/egg/test/fixtures/custom-egg/index.js(1 hunks)packages/egg/test/lib/core/context_httpclient.test.ts(1 hunks)packages/egg/test/lib/core/context_performance_starttime.test.ts(1 hunks)packages/egg/test/lib/core/cookies.test.ts(8 hunks)packages/egg/test/lib/core/httpclient.test.ts(1 hunks)packages/egg/test/lib/core/httpclient_tracer_demo.test.ts(1 hunks)packages/egg/test/lib/core/loader/config_loader.test.ts(1 hunks)packages/egg/test/lib/core/loader/load_boot.test.ts(2 hunks)packages/egg/test/lib/core/loader/load_plugin.test.ts(3 hunks)packages/egg/test/lib/core/loader/load_service.test.ts(1 hunks)packages/egg/test/lib/core/logger.test.ts(12 hunks)packages/egg/test/lib/core/messenger/ipc.test.ts(2 hunks)packages/egg/test/lib/core/messenger/local.test.ts(1 hunks)packages/egg/test/lib/core/router.test.ts(3 hunks)packages/egg/test/lib/core/utils.test.ts(3 hunks)packages/egg/test/lib/core/view.test.ts(2 hunks)packages/egg/test/lib/plugins/depd.test.ts(1 hunks)packages/egg/test/lib/plugins/development.test.ts(2 hunks)packages/egg/test/lib/plugins/i18n.test.ts(3 hunks)packages/egg/test/lib/plugins/logrotator.test.ts(1 hunks)packages/egg/test/lib/plugins/onerror.test.ts(1 hunks)packages/egg/test/lib/plugins/schedule.test.ts(1 hunks)packages/egg/test/lib/plugins/security.test.ts(2 hunks)packages/egg/test/lib/plugins/watcher.test.ts(4 hunks)packages/egg/test/typescript.test.ts(1 hunks)packages/egg/test/utils.ts(3 hunks)packages/egg/vitest.config.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
packages/**/test/**/*.test.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
packages/**/test/**/*.test.ts: Name test files as test/**/*.test.ts and run them with Vitest
Use import { describe, it } from 'vitest' in tests
Use Node.js built-in assert module for test assertions
Files:
packages/egg/test/app/extend/response.test.tspackages/egg/test/app/middleware/body_parser.test.tspackages/egg/test/cluster1/cluster-client-error.test.tspackages/egg/test/typescript.test.tspackages/egg/test/lib/core/cookies.test.tspackages/egg/test/lib/core/loader/load_plugin.test.tspackages/egg/test/lib/core/utils.test.tspackages/egg/test/lib/core/loader/load_service.test.tspackages/egg/test/lib/plugins/schedule.test.tspackages/egg/test/lib/core/router.test.tspackages/egg/test/lib/plugins/watcher.test.tspackages/egg/test/lib/plugins/i18n.test.tspackages/egg/test/app/extend/helper.test.tspackages/egg/test/application.test.tspackages/egg/test/lib/core/context_httpclient.test.tspackages/egg/test/lib/plugins/development.test.tspackages/egg/test/lib/plugins/logrotator.test.tspackages/egg/test/cluster1/master.test.tspackages/egg/test/lib/core/logger.test.tspackages/egg/test/lib/core/view.test.tspackages/egg/test/lib/plugins/security.test.tspackages/egg/test/cluster1/cluster-client.test.tspackages/egg/test/lib/core/messenger/ipc.test.tspackages/egg/test/lib/plugins/onerror.test.tspackages/egg/test/app/extend/request.test.tspackages/egg/test/egg.test.tspackages/egg/test/agent.test.tspackages/egg/test/cluster1/app_worker.test.tspackages/egg/test/app/middleware/override_method.test.tspackages/egg/test/app/extend/context.jsonp.test.tspackages/egg/test/lib/core/context_performance_starttime.test.tspackages/egg/test/app/middleware/notfound.test.tspackages/egg/test/lib/core/messenger/local.test.tspackages/egg/test/cluster2/master.test.tspackages/egg/test/lib/core/loader/load_boot.test.tspackages/egg/test/lib/core/httpclient.test.tspackages/egg/test/app/middleware/site_file.test.tspackages/egg/test/lib/plugins/depd.test.tspackages/egg/test/lib/core/httpclient_tracer_demo.test.tspackages/egg/test/asyncSupport.test.tspackages/egg/test/app/extend/application.test.tspackages/egg/test/app/extend/context.test.tspackages/egg/test/lib/core/loader/config_loader.test.tspackages/egg/test/app/middleware/meta.test.ts
{packages,plugins}/**/test/**/*.test.ts
📄 CodeRabbit inference engine (CLAUDE.md)
{packages,plugins}/**/test/**/*.test.ts: Vitest test files should follow the naming pattern test/**/*.test.ts and import from vitest
Use Node.js built-in assert for assertions in Vitest tests
Files:
packages/egg/test/app/extend/response.test.tspackages/egg/test/app/middleware/body_parser.test.tspackages/egg/test/cluster1/cluster-client-error.test.tspackages/egg/test/typescript.test.tspackages/egg/test/lib/core/cookies.test.tspackages/egg/test/lib/core/loader/load_plugin.test.tspackages/egg/test/lib/core/utils.test.tspackages/egg/test/lib/core/loader/load_service.test.tspackages/egg/test/lib/plugins/schedule.test.tspackages/egg/test/lib/core/router.test.tspackages/egg/test/lib/plugins/watcher.test.tspackages/egg/test/lib/plugins/i18n.test.tspackages/egg/test/app/extend/helper.test.tspackages/egg/test/application.test.tspackages/egg/test/lib/core/context_httpclient.test.tspackages/egg/test/lib/plugins/development.test.tspackages/egg/test/lib/plugins/logrotator.test.tspackages/egg/test/cluster1/master.test.tspackages/egg/test/lib/core/logger.test.tspackages/egg/test/lib/core/view.test.tspackages/egg/test/lib/plugins/security.test.tspackages/egg/test/cluster1/cluster-client.test.tspackages/egg/test/lib/core/messenger/ipc.test.tspackages/egg/test/lib/plugins/onerror.test.tspackages/egg/test/app/extend/request.test.tspackages/egg/test/egg.test.tspackages/egg/test/agent.test.tspackages/egg/test/cluster1/app_worker.test.tspackages/egg/test/app/middleware/override_method.test.tspackages/egg/test/app/extend/context.jsonp.test.tspackages/egg/test/lib/core/context_performance_starttime.test.tspackages/egg/test/app/middleware/notfound.test.tspackages/egg/test/lib/core/messenger/local.test.tspackages/egg/test/cluster2/master.test.tspackages/egg/test/lib/core/loader/load_boot.test.tspackages/egg/test/lib/core/httpclient.test.tspackages/egg/test/app/middleware/site_file.test.tspackages/egg/test/lib/plugins/depd.test.tspackages/egg/test/lib/core/httpclient_tracer_demo.test.tspackages/egg/test/asyncSupport.test.tspackages/egg/test/app/extend/application.test.tspackages/egg/test/app/extend/context.test.tspackages/egg/test/lib/core/loader/config_loader.test.tspackages/egg/test/app/middleware/meta.test.ts
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
**/*.ts: Prefer TypeScript and ESM: write sources and exports in .ts (ESM-first) rather than CommonJS
Use two-space indentation, trailing commas, and semicolons (Prettier/oxlint defaults)
Name files in lowercase with hyphens (e.g., loader-context.ts)
Name classes in PascalCase
Name functions and variables in camelCase
Re-export types thoughtfully to keep the public API stable
Files:
packages/egg/test/app/extend/response.test.tspackages/egg/test/app/middleware/body_parser.test.tspackages/egg/test/cluster1/cluster-client-error.test.tspackages/egg/test/typescript.test.tspackages/egg/test/lib/core/cookies.test.tspackages/egg/test/lib/core/loader/load_plugin.test.tspackages/egg/test/lib/core/utils.test.tspackages/egg/test/lib/core/loader/load_service.test.tspackages/egg/test/lib/plugins/schedule.test.tspackages/egg/src/lib/agent.tspackages/egg/src/lib/core/messenger/base.tspackages/egg/src/lib/core/messenger/ipc.tspackages/egg/test/lib/core/router.test.tspackages/egg/test/lib/plugins/watcher.test.tspackages/egg/test/lib/plugins/i18n.test.tspackages/egg/test/app/extend/helper.test.tspackages/egg/src/app/middleware/meta.tspackages/egg/test/application.test.tspackages/egg/test/lib/core/context_httpclient.test.tspackages/egg/test/lib/plugins/development.test.tspackages/egg/test/lib/plugins/logrotator.test.tspackages/egg/vitest.config.tspackages/egg/test/cluster1/master.test.tspackages/egg/test/fixtures/apps/app-ts-type-check/normal.tspackages/egg/test/lib/core/logger.test.tspackages/egg/test/lib/core/view.test.tspackages/egg/test/lib/plugins/security.test.tspackages/egg/test/cluster1/cluster-client.test.tspackages/egg/test/lib/core/messenger/ipc.test.tspackages/egg/test/lib/plugins/onerror.test.tspackages/egg/test/app/extend/request.test.tspackages/egg/src/lib/core/httpclient.tspackages/egg/test/egg.test.tspackages/egg/src/app/extend/helper.tspackages/egg/test/agent.test.tspackages/egg/test/cluster1/app_worker.test.tspackages/egg/src/lib/core/base_hook_class.tspackages/egg/src/lib/core/logger.tspackages/egg/test/app/middleware/override_method.test.tspackages/egg/test/app/extend/context.jsonp.test.tspackages/egg/test/lib/core/context_performance_starttime.test.tspackages/egg/test/app/middleware/notfound.test.tspackages/egg/test/lib/core/messenger/local.test.tspackages/egg/test/cluster2/master.test.tspackages/egg/test/lib/core/loader/load_boot.test.tspackages/egg/src/app/extend/request.tspackages/egg/src/lib/egg.tspackages/egg/test/lib/core/httpclient.test.tspackages/egg/test/app/middleware/site_file.test.tspackages/egg/test/fixtures/apps/app-ts-type-check/error.tspackages/egg/src/lib/core/context_httpclient.tspackages/egg/src/config/config.default.tspackages/egg/test/lib/plugins/depd.test.tspackages/egg/test/lib/core/httpclient_tracer_demo.test.tspackages/egg/src/lib/application.tspackages/egg/test/asyncSupport.test.tspackages/egg/test/app/extend/application.test.tspackages/egg/src/lib/core/messenger/index.tspackages/egg/src/lib/core/utils.tspackages/egg/test/app/extend/context.test.tspackages/egg/src/lib/types.tspackages/egg/test/fixtures/apps/app-ts/app/router.tspackages/egg/src/index.tspackages/egg/test/lib/core/loader/config_loader.test.tspackages/egg/src/lib/core/messenger/local.tspackages/egg/test/utils.tspackages/egg/test/app/middleware/meta.test.tspackages/egg/src/app/extend/context.ts
**/test/**/*.test.ts
📄 CodeRabbit inference engine (AGENTS.md)
**/test/**/*.test.ts: Place test suites following Vitest discovery: /test//*.test.ts
Mirror the repository test pattern when adding new suites
Files:
packages/egg/test/app/extend/response.test.tspackages/egg/test/app/middleware/body_parser.test.tspackages/egg/test/cluster1/cluster-client-error.test.tspackages/egg/test/typescript.test.tspackages/egg/test/lib/core/cookies.test.tspackages/egg/test/lib/core/loader/load_plugin.test.tspackages/egg/test/lib/core/utils.test.tspackages/egg/test/lib/core/loader/load_service.test.tspackages/egg/test/lib/plugins/schedule.test.tspackages/egg/test/lib/core/router.test.tspackages/egg/test/lib/plugins/watcher.test.tspackages/egg/test/lib/plugins/i18n.test.tspackages/egg/test/app/extend/helper.test.tspackages/egg/test/application.test.tspackages/egg/test/lib/core/context_httpclient.test.tspackages/egg/test/lib/plugins/development.test.tspackages/egg/test/lib/plugins/logrotator.test.tspackages/egg/test/cluster1/master.test.tspackages/egg/test/lib/core/logger.test.tspackages/egg/test/lib/core/view.test.tspackages/egg/test/lib/plugins/security.test.tspackages/egg/test/cluster1/cluster-client.test.tspackages/egg/test/lib/core/messenger/ipc.test.tspackages/egg/test/lib/plugins/onerror.test.tspackages/egg/test/app/extend/request.test.tspackages/egg/test/egg.test.tspackages/egg/test/agent.test.tspackages/egg/test/cluster1/app_worker.test.tspackages/egg/test/app/middleware/override_method.test.tspackages/egg/test/app/extend/context.jsonp.test.tspackages/egg/test/lib/core/context_performance_starttime.test.tspackages/egg/test/app/middleware/notfound.test.tspackages/egg/test/lib/core/messenger/local.test.tspackages/egg/test/cluster2/master.test.tspackages/egg/test/lib/core/loader/load_boot.test.tspackages/egg/test/lib/core/httpclient.test.tspackages/egg/test/app/middleware/site_file.test.tspackages/egg/test/lib/plugins/depd.test.tspackages/egg/test/lib/core/httpclient_tracer_demo.test.tspackages/egg/test/asyncSupport.test.tspackages/egg/test/app/extend/application.test.tspackages/egg/test/app/extend/context.test.tspackages/egg/test/lib/core/loader/config_loader.test.tspackages/egg/test/app/middleware/meta.test.ts
packages/**/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use TypeScript for all source files in packages (no JavaScript source files)
Files:
packages/egg/src/lib/agent.tspackages/egg/src/lib/core/messenger/base.tspackages/egg/src/lib/core/messenger/ipc.tspackages/egg/src/app/middleware/meta.tspackages/egg/src/lib/core/httpclient.tspackages/egg/src/app/extend/helper.tspackages/egg/src/lib/core/base_hook_class.tspackages/egg/src/lib/core/logger.tspackages/egg/src/app/extend/request.tspackages/egg/src/lib/egg.tspackages/egg/src/lib/core/context_httpclient.tspackages/egg/src/config/config.default.tspackages/egg/src/lib/application.tspackages/egg/src/lib/core/messenger/index.tspackages/egg/src/lib/core/utils.tspackages/egg/src/lib/types.tspackages/egg/src/index.tspackages/egg/src/lib/core/messenger/local.tspackages/egg/src/app/extend/context.ts
packages/egg/src/lib/core/**
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Implement core components (httpclient, logger, messenger) under packages/egg/src/lib/core/
Files:
packages/egg/src/lib/core/messenger/base.tspackages/egg/src/lib/core/messenger/ipc.tspackages/egg/src/lib/core/httpclient.tspackages/egg/src/lib/core/base_hook_class.tspackages/egg/src/lib/core/logger.tspackages/egg/src/lib/core/context_httpclient.tspackages/egg/src/lib/core/messenger/index.tspackages/egg/src/lib/core/utils.tspackages/egg/src/lib/core/messenger/local.ts
packages/egg/test/fixtures/apps/**
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Place scenario test fixtures under packages/egg/test/fixtures/apps/
Create test apps under packages/egg/test/fixtures/apps for scenario-based testing
Files:
packages/egg/test/fixtures/apps/multiple-view-engine/app/controller/view.jspackages/egg/test/fixtures/apps/tracer-demo/tracer.jspackages/egg/test/fixtures/apps/i18n/app/controller/message.jspackages/egg/test/fixtures/apps/multipart/app/controller/upload.jspackages/egg/test/fixtures/apps/ctx-background/app/controller/home.jspackages/egg/test/fixtures/apps/multiple-view-engine/config/config.default.jspackages/egg/test/fixtures/apps/app-ts-type-check/normal.tspackages/egg/test/fixtures/apps/multiple-view-engine/app/router.jspackages/egg/test/fixtures/apps/view-render/app/view/index.htmlpackages/egg/test/fixtures/apps/httpclient-overwrite/app.jspackages/egg/test/fixtures/apps/subdir-services/app/controller/home.jspackages/egg/test/fixtures/apps/view-render/app/view/locals.htmlpackages/egg/test/fixtures/apps/app-enableFastContextLogger/app/controller/home.jspackages/egg/test/fixtures/apps/messenger-broadcast/agent.jspackages/egg/test/fixtures/apps/helper/app/router.jspackages/egg/test/fixtures/apps/messenger-random/app.jspackages/egg/test/fixtures/apps/ctx-background/app/controller/app.jspackages/egg/test/fixtures/apps/app-ts-type-check/error.tspackages/egg/test/fixtures/apps/view-render/app/view/inject.htmlpackages/egg/test/fixtures/apps/multipart/app/view/home.htmlpackages/egg/test/fixtures/apps/middlewares/config/config.default.jspackages/egg/test/fixtures/apps/messenger-broadcast/app.jspackages/egg/test/fixtures/apps/app-ts/app/router.tspackages/egg/test/fixtures/apps/httpclient-next-overwrite/app.js
**/test/fixtures/**
📄 CodeRabbit inference engine (AGENTS.md)
Put reusable test data under test/fixtures/
Files:
packages/egg/test/fixtures/apps/multiple-view-engine/app/controller/view.jspackages/egg/test/fixtures/apps/tracer-demo/tracer.jspackages/egg/test/fixtures/apps/i18n/app/controller/message.jspackages/egg/test/fixtures/apps/multipart/app/controller/upload.jspackages/egg/test/fixtures/apps/ctx-background/app/controller/home.jspackages/egg/test/fixtures/apps/multiple-view-engine/config/config.default.jspackages/egg/test/fixtures/apps/app-ts-type-check/normal.tspackages/egg/test/fixtures/apps/multiple-view-engine/app/router.jspackages/egg/test/fixtures/apps/view-render/app/view/index.htmlpackages/egg/test/fixtures/custom-egg/index.jspackages/egg/test/fixtures/apps/httpclient-overwrite/app.jspackages/egg/test/fixtures/apps/subdir-services/app/controller/home.jspackages/egg/test/fixtures/apps/view-render/app/view/locals.htmlpackages/egg/test/fixtures/apps/app-enableFastContextLogger/app/controller/home.jspackages/egg/test/fixtures/apps/messenger-broadcast/agent.jspackages/egg/test/fixtures/apps/helper/app/router.jspackages/egg/test/fixtures/apps/messenger-random/app.jspackages/egg/test/fixtures/apps/ctx-background/app/controller/app.jspackages/egg/test/fixtures/apps/app-ts-type-check/error.tspackages/egg/test/fixtures/apps/view-render/app/view/inject.htmlpackages/egg/test/fixtures/apps/multipart/app/view/home.htmlpackages/egg/test/fixtures/apps/middlewares/config/config.default.jspackages/egg/test/fixtures/apps/messenger-broadcast/app.jspackages/egg/test/fixtures/apps/app-ts/app/router.tspackages/egg/test/fixtures/apps/httpclient-next-overwrite/app.js
{packages,plugins}/**/vitest.config.ts
📄 CodeRabbit inference engine (CLAUDE.md)
Each non-CLI package must include a vitest.config.ts for test configuration
Files:
packages/egg/vitest.config.ts
packages/egg/src/app/extend/**
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Place framework extensions (context, helper, request, response) under packages/egg/src/app/extend/
Files:
packages/egg/src/app/extend/helper.tspackages/egg/src/app/extend/request.tspackages/egg/src/app/extend/context.ts
packages/egg/src/config/**
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Store default configurations and plugin configs under packages/egg/src/config/
Files:
packages/egg/src/config/config.default.ts
🧠 Learnings (13)
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to {packages,plugins}/**/test/**/*.test.ts : Use Node.js built-in assert for assertions in Vitest tests
Applied to files:
packages/egg/test/app/extend/response.test.tspackages/egg/test/typescript.test.tspackages/egg/test/lib/core/cookies.test.tspackages/egg/test/lib/core/utils.test.tspackages/egg/test/lib/plugins/watcher.test.tspackages/egg/test/app/extend/helper.test.tspackages/egg/test/application.test.tspackages/egg/test/lib/core/context_httpclient.test.tspackages/egg/test/lib/plugins/development.test.tspackages/egg/test/lib/plugins/logrotator.test.tspackages/egg/vitest.config.tspackages/egg/test/lib/core/logger.test.tspackages/egg/test/lib/core/view.test.tspackages/egg/test/lib/plugins/onerror.test.tspackages/egg/test/app/extend/request.test.tspackages/egg/test/egg.test.tspackages/egg/test/agent.test.tspackages/egg/test/cluster1/app_worker.test.tspackages/egg/test/lib/core/context_performance_starttime.test.tspackages/egg/test/app/middleware/notfound.test.tspackages/egg/test/lib/core/messenger/local.test.tspackages/egg/test/app/middleware/site_file.test.tspackages/egg/test/lib/plugins/depd.test.tspackages/egg/test/lib/core/httpclient_tracer_demo.test.tspackages/egg/test/app/extend/application.test.tspackages/egg/test/app/extend/context.test.tspackages/egg/test/app/middleware/meta.test.ts
📚 Learning: 2025-09-14T08:41:30.618Z
Learnt from: CR
PR: eggjs/egg#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-14T08:41:30.618Z
Learning: Applies to packages/**/test/**/*.test.ts : Use Node.js built-in assert module for test assertions
Applied to files:
packages/egg/test/app/extend/response.test.tspackages/egg/test/typescript.test.tspackages/egg/test/lib/core/cookies.test.tspackages/egg/test/lib/core/loader/load_plugin.test.tspackages/egg/test/lib/core/utils.test.tspackages/egg/test/lib/core/loader/load_service.test.tspackages/egg/test/lib/plugins/watcher.test.tspackages/egg/test/app/extend/helper.test.tspackages/egg/test/application.test.tspackages/egg/test/lib/plugins/development.test.tspackages/egg/vitest.config.tspackages/egg/test/lib/core/logger.test.tspackages/egg/test/lib/plugins/onerror.test.tspackages/egg/test/app/extend/request.test.tspackages/egg/test/egg.test.tspackages/egg/test/agent.test.tspackages/egg/test/cluster1/app_worker.test.tspackages/egg/test/lib/core/context_performance_starttime.test.tspackages/egg/test/app/middleware/notfound.test.tspackages/egg/test/lib/core/messenger/local.test.tspackages/egg/test/app/middleware/site_file.test.tspackages/egg/test/lib/plugins/depd.test.tspackages/egg/test/lib/core/httpclient_tracer_demo.test.tspackages/egg/test/asyncSupport.test.tspackages/egg/test/app/extend/application.test.tspackages/egg/test/app/extend/context.test.ts
📚 Learning: 2025-09-18T07:56:17.417Z
Learnt from: CR
PR: eggjs/egg#0
File: AGENTS.md:0-0
Timestamp: 2025-09-18T07:56:17.417Z
Learning: For features affecting HTTP or process orchestration, add regression tests that exercise both the CommonJS and TypeScript example apps
Applied to files:
packages/egg/test/app/extend/response.test.tspackages/egg/test/app/middleware/body_parser.test.tspackages/egg/test/typescript.test.tspackages/egg/test/lib/core/router.test.tspackages/egg/test/app/extend/helper.test.tspackages/egg/test/application.test.tspackages/egg/test/lib/core/logger.test.tspackages/egg/test/lib/core/view.test.tspackages/egg/test/lib/plugins/security.test.tspackages/egg/test/cluster1/cluster-client.test.tspackages/egg/test/app/extend/request.test.tspackages/egg/test/egg.test.tspackages/egg/test/agent.test.tspackages/egg/test/cluster1/app_worker.test.tspackages/egg/test/app/middleware/override_method.test.tspackages/egg/test/app/middleware/notfound.test.tspackages/egg/test/lib/core/messenger/local.test.tspackages/egg/test/cluster2/master.test.tspackages/egg/test/lib/core/httpclient.test.tspackages/egg/test/app/middleware/site_file.test.tspackages/egg/test/lib/plugins/depd.test.tspackages/egg/test/lib/core/httpclient_tracer_demo.test.tspackages/egg/test/asyncSupport.test.tspackages/egg/test/app/extend/application.test.tspackages/egg/test/app/extend/context.test.tspackages/egg/test/app/middleware/meta.test.ts
📚 Learning: 2025-09-18T07:56:17.417Z
Learnt from: CR
PR: eggjs/egg#0
File: AGENTS.md:0-0
Timestamp: 2025-09-18T07:56:17.417Z
Learning: Applies to **/*.ts : Re-export types thoughtfully to keep the public API stable
Applied to files:
packages/egg/test/typescript.test.tspackages/egg/test/fixtures/apps/app-ts-type-check/error.tspackages/egg/src/lib/core/utils.ts
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to tools/egg-bin/test/**/*.test.ts : egg-bin (CLI tool) tests must use Mocha
Applied to files:
packages/egg/test/typescript.test.tspackages/egg/test/lib/core/cookies.test.tspackages/egg/test/lib/core/loader/load_plugin.test.tspackages/egg/test/lib/core/utils.test.tspackages/egg/test/lib/plugins/watcher.test.tspackages/egg/test/app/extend/helper.test.tspackages/egg/test/application.test.tspackages/egg/test/lib/plugins/development.test.tspackages/egg/vitest.config.tspackages/egg/test/lib/core/logger.test.tspackages/egg/test/app/extend/request.test.tspackages/egg/test/egg.test.tspackages/egg/test/agent.test.tspackages/egg/test/cluster1/app_worker.test.tspackages/egg/test/lib/core/messenger/local.test.tspackages/egg/test/cluster2/master.test.tspackages/egg/test/lib/plugins/depd.test.tspackages/egg/test/asyncSupport.test.tspackages/egg/test/app/extend/application.test.tspackages/egg/test/utils.ts
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to plugins/*/package.json : Plugin package.json must include an eggPlugin configuration field
Applied to files:
packages/egg/test/lib/core/loader/load_plugin.test.ts
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to {packages,plugins}/**/test/**/*.test.ts : Vitest test files should follow the naming pattern test/**/*.test.ts and import from vitest
Applied to files:
packages/egg/test/lib/plugins/watcher.test.tspackages/egg/test/application.test.tspackages/egg/test/lib/core/context_httpclient.test.tspackages/egg/test/lib/plugins/development.test.tspackages/egg/test/lib/plugins/logrotator.test.tspackages/egg/vitest.config.tspackages/egg/test/app/extend/request.test.tspackages/egg/test/egg.test.tspackages/egg/test/agent.test.tspackages/egg/test/cluster1/app_worker.test.tspackages/egg/test/app/extend/application.test.ts
📚 Learning: 2025-09-14T08:41:30.618Z
Learnt from: CR
PR: eggjs/egg#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-14T08:41:30.618Z
Learning: Applies to packages/**/test/**/*.test.ts : Name test files as test/**/*.test.ts and run them with Vitest
Applied to files:
packages/egg/test/lib/plugins/watcher.test.tspackages/egg/test/application.test.tspackages/egg/test/lib/plugins/development.test.tspackages/egg/vitest.config.tspackages/egg/test/app/extend/request.test.tspackages/egg/test/agent.test.tspackages/egg/test/app/extend/application.test.ts
📚 Learning: 2025-09-14T08:41:30.618Z
Learnt from: CR
PR: eggjs/egg#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-14T08:41:30.618Z
Learning: Applies to packages/**/test/**/*.test.ts : Use import { describe, it } from 'vitest' in tests
Applied to files:
packages/egg/test/lib/plugins/watcher.test.tspackages/egg/test/application.test.tspackages/egg/test/lib/core/context_httpclient.test.tspackages/egg/test/lib/plugins/development.test.tspackages/egg/test/app/extend/request.test.tspackages/egg/test/egg.test.tspackages/egg/test/agent.test.tspackages/egg/test/cluster1/app_worker.test.tspackages/egg/test/cluster2/master.test.tspackages/egg/test/lib/plugins/depd.test.tspackages/egg/test/lib/core/httpclient_tracer_demo.test.tspackages/egg/test/asyncSupport.test.tspackages/egg/test/lib/core/loader/config_loader.test.tspackages/egg/test/app/middleware/meta.test.ts
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to {packages,plugins}/**/vitest.config.ts : Each non-CLI package must include a vitest.config.ts for test configuration
Applied to files:
packages/egg/test/application.test.tspackages/egg/test/lib/plugins/development.test.tspackages/egg/vitest.config.ts
📚 Learning: 2025-09-18T07:56:17.417Z
Learnt from: CR
PR: eggjs/egg#0
File: AGENTS.md:0-0
Timestamp: 2025-09-18T07:56:17.417Z
Learning: Applies to **/test/**/*.test.ts : Place test suites following Vitest discovery: **/test/**/*.test.ts
Applied to files:
packages/egg/test/application.test.ts
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to plugins/*/package.json : Plugin package.json must export TS sources in development ("exports": { ".": "./src/index.ts", "./agent": "./src/agent.ts", "./app": "./src/app.ts", "./package.json": "./package.json" })
Applied to files:
packages/egg/test/lib/plugins/development.test.ts
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to packages/egg/tsconfig.json : packages/egg/tsconfig.json must extend eggjs/tsconfig and enable strict mode
Applied to files:
packages/egg/test/egg.test.ts
🧬 Code graph analysis (31)
packages/egg/test/cluster1/cluster-client-error.test.ts (1)
packages/egg/test/utils.ts (1)
getFilepath(127-129)
packages/egg/test/typescript.test.ts (2)
packages/egg/test/fixtures/apps/app-ts/app/router.ts (1)
app(4-10)packages/egg/test/utils.ts (1)
app(31-36)
packages/egg/test/lib/core/cookies.test.ts (1)
packages/egg/test/utils.ts (1)
getFilepath(127-129)
packages/egg/test/lib/plugins/schedule.test.ts (1)
packages/egg/test/utils.ts (1)
getFilepath(127-129)
packages/egg/src/lib/core/messenger/ipc.ts (1)
packages/egg/src/lib/core/base_context_logger.ts (1)
debug(37-39)
packages/egg/test/lib/plugins/watcher.test.ts (1)
packages/egg/test/utils.ts (1)
getFilepath(127-129)
packages/egg/test/application.test.ts (1)
packages/egg/test/utils.ts (1)
getFilepath(127-129)
packages/egg/test/fixtures/apps/ctx-background/app/controller/home.js (1)
packages/egg/test/fixtures/apps/ctx-background/app/controller/app.js (1)
buf(6-6)
packages/egg/test/lib/plugins/logrotator.test.ts (1)
packages/utils/src/import.ts (1)
importResolve(317-448)
packages/egg/test/fixtures/apps/multiple-view-engine/config/config.default.js (1)
packages/egg/src/config/config.default.ts (1)
appInfo(14-407)
packages/egg/test/cluster1/master.test.ts (1)
packages/egg/test/utils.ts (1)
getFilepath(127-129)
packages/egg/test/fixtures/apps/multiple-view-engine/app/router.js (1)
packages/egg/test/fixtures/apps/app-ts/app/router.ts (1)
app(4-10)
packages/egg/test/lib/core/logger.test.ts (1)
packages/egg/test/utils.ts (1)
getFilepath(127-129)
packages/egg/test/fixtures/custom-egg/index.js (2)
packages/egg/src/index.ts (1)
Application(46-46)packages/egg/src/lib/application.ts (1)
Application(43-299)
packages/egg/test/fixtures/apps/httpclient-overwrite/app.js (1)
packages/egg/test/fixtures/apps/httpclient-next-overwrite/app.js (1)
assert(1-1)
packages/egg/test/egg.test.ts (1)
packages/egg/test/utils.ts (4)
getFilepath(127-129)app(31-36)createApp(38-38)MockApplication(24-24)
packages/egg/src/lib/core/logger.ts (1)
packages/egg/src/lib/egg.ts (1)
loggers(405-410)
packages/egg/test/app/middleware/notfound.test.ts (2)
packages/egg/test/fixtures/apps/app-ts/app/router.ts (1)
app(4-10)packages/egg/test/utils.ts (2)
app(31-36)mm(23-23)
packages/egg/test/cluster2/master.test.ts (2)
packages/mock/src/register.ts (3)
afterEach(29-36)beforeAll(22-28)afterAll(37-45)packages/egg/test/utils.ts (4)
mm(23-23)app(31-36)MockApplication(24-24)cluster(47-50)
packages/egg/test/fixtures/apps/ctx-background/app/controller/app.js (1)
packages/egg/test/fixtures/apps/ctx-background/app/controller/home.js (3)
buf(6-6)buf(10-10)fs(1-1)
packages/egg/src/lib/egg.ts (1)
packages/core/src/egg.ts (4)
EggCoreOptions(37-43)MiddlewareFunc(101-102)Context(64-98)url(449-451)
packages/egg/test/lib/core/httpclient.test.ts (5)
packages/egg/src/lib/egg.ts (2)
client(590-597)httpclient(396-398)packages/egg/src/lib/core/context_httpclient.ts (1)
ContextHttpClient(4-31)packages/egg/test/utils.ts (2)
startLocalServer(80-125)app(31-36)packages/egg/src/lib/core/httpclient.ts (3)
HttpClient(22-52)HttpClient(55-55)HttpClient(55-55)packages/egg/src/app/extend/context.ts (1)
httpclient(60-65)
packages/egg/src/lib/core/context_httpclient.ts (1)
packages/egg/src/lib/core/httpclient.ts (1)
HttpClientRequestOptions(17-20)
packages/egg/test/lib/plugins/depd.test.ts (2)
packages/mock/src/register.ts (3)
afterEach(29-36)beforeAll(22-28)afterAll(37-45)packages/egg/test/utils.ts (4)
mm(23-23)app(31-36)MockApplication(24-24)createApp(38-38)
packages/egg/src/lib/application.ts (2)
packages/core/src/loader/file_loader.ts (2)
FULLPATH(19-19)FULLPATH(73-75)packages/egg/src/app/extend/context.ts (1)
Context(26-303)
packages/egg/test/asyncSupport.test.ts (2)
packages/mock/src/register.ts (3)
afterEach(29-36)beforeAll(22-28)afterAll(37-45)packages/egg/test/utils.ts (4)
restore(29-29)app(31-36)MockApplication(24-24)createApp(38-38)
packages/egg/src/lib/types.ts (1)
packages/core/src/loader/file_loader.ts (1)
FileLoaderOptions(36-60)
packages/egg/src/lib/core/messenger/local.ts (1)
packages/egg/src/lib/core/base_context_logger.ts (1)
debug(37-39)
packages/egg/test/utils.ts (2)
packages/cluster/test/utils.ts (1)
cluster(5-17)packages/egg/src/lib/start.ts (2)
StartEggOptions(10-20)SingleModeApplication(22-24)
packages/egg/src/app/extend/context.ts (1)
packages/egg/src/lib/core/httpclient.ts (4)
HttpClientRequestOptions(17-20)HttpClient(22-52)HttpClient(55-55)HttpClient(55-55)
packages/egg/test/fixtures/apps/httpclient-next-overwrite/app.js (1)
packages/egg/test/fixtures/apps/httpclient-overwrite/app.js (1)
assert(3-3)
🪛 Biome (2.1.2)
packages/egg/test/fixtures/apps/subdir-services/app/controller/home.js
[error] 11-11: Comparing to itself is potentially pointless.
(lint/suspicious/noSelfCompare)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: Test egg-bin (windows-latest, 22)
- GitHub Check: Test egg-bin (macos-latest, 24)
- GitHub Check: Test egg-bin (windows-latest, 24)
- GitHub Check: Test egg-bin (macos-latest, 22)
- GitHub Check: Test egg-bin (ubuntu-latest, 24)
- GitHub Check: Test egg-bin (ubuntu-latest, 22)
- GitHub Check: Test packages (windows-latest, 22)
- GitHub Check: Test packages (windows-latest, 24)
- GitHub Check: Test packages (macos-latest, 24)
- GitHub Check: Test packages (ubuntu-latest, 24)
- GitHub Check: Test packages (macos-latest, 22)
- GitHub Check: Test packages (ubuntu-latest, 22)
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## next #5530 +/- ##
==========================================
- Coverage 76.31% 75.93% -0.39%
==========================================
Files 113 113
Lines 5891 5768 -123
Branches 1237 1152 -85
==========================================
- Hits 4496 4380 -116
+ Misses 1218 1208 -10
- Partials 177 180 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

Summary by CodeRabbit