-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat: 添加 mock 引用校验 #10447
feat: 添加 mock 引用校验 #10447
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Size Change: +1.13 kB (0%) Total Size: 9.92 MB
ℹ️ View Unchanged
|
if (source.includes('/mock/')) { | ||
let resolvePath: string | undefined; | ||
try { | ||
resolvePath = path.resolve(source); |
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.
这个地方是不是应该是 🤔 :
path.resolve(api.cwd, source)
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.
🙈 我晚上改一下 👌
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.
用 prepare 流程做,不用 onCheckCode。比如这样。
api.onPrepareBuildSuccess(({ result }) => {
const imps = Object.keys(result.metafile.inputs).filter(f => f.startsWith('mock/'));
if (imps.length) {
throw new Error(`Detected mock imports: ${imps.join(', ')}`);
}
});
👌 |
Codecov ReportBase: 29.67% // Head: 29.61% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #10447 +/- ##
==========================================
- Coverage 29.67% 29.61% -0.07%
==========================================
Files 445 446 +1
Lines 13013 13040 +27
Branches 3069 3074 +5
==========================================
Hits 3862 3862
- Misses 8511 8535 +24
- Partials 640 643 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
No description provided.