Skip to content
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

fix: fix mocha failed title for inject_ctx #162

Merged
merged 1 commit into from
Jun 21, 2023
Merged

Conversation

killagu
Copy link
Contributor

@killagu killagu commented Jun 21, 2023

this.fail is only safe in runTests and should
not be called in runSuite.

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

this.fail is only safe in runTests and should
not be called in runSuite.
try {
app = await appHandler.getApp(suite);
debug('get app: %s', !!app);
} catch (err) {
err.message = `[egg-mock/runSuite] get app for ${getTestTitle(suite)}: ${err.message}`;
this.fail(suite, err);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runner.fail 不应该在 runner.runSuite 中调用,可能导致 mocha 内部状态出问题。

@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.02 ⚠️

Comparison is base (7de47a1) 85.76% compared to head (740aa53) 85.75%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #162      +/-   ##
==========================================
- Coverage   85.76%   85.75%   -0.02%     
==========================================
  Files          27       27              
  Lines        2579     2583       +4     
  Branches      468      470       +2     
==========================================
+ Hits         2212     2215       +3     
- Misses        367      368       +1     
Impacted Files Coverage Δ
lib/inject_context.js 96.96% <100.00%> (-0.69%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@fengmk2 fengmk2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@fengmk2 fengmk2 merged commit f6f59ac into master Jun 21, 2023
@fengmk2 fengmk2 deleted the fix/mocha_title branch June 21, 2023 07:10
fengmk2 pushed a commit that referenced this pull request Jun 21, 2023
[skip ci]

## [5.10.8](v5.10.7...v5.10.8) (2023-06-21)

### Bug Fixes

* fix mocha failed title for inject_ctx ([#162](#162)) ([f6f59ac](f6f59ac))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants