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(tests): 修复一些测试问题 #893

Merged
merged 3 commits into from
Oct 15, 2023
Merged

fix(tests): 修复一些测试问题 #893

merged 3 commits into from
Oct 15, 2023

Conversation

ddadaal
Copy link
Member

@ddadaal ddadaal commented Oct 14, 2023

  1. apps/mis-server/tests/charging/charging.test.tsconcurrently pays中,增加充值记录后查询新增的充值记录的endTime设置为当前时间往后一天,确保能获取到最新的记录
  2. 所有关于测试一个Entity中的boolean属性是否为true/false的改为使用toBeTruthy()或者toBeFalsy()。因为当前配置下修改Entity的boolean属性后,重新读取出来的entity的这个属性为1或者0。无法重现这个问题。但是由于一般使用boolean字段都是使用是否为truthy值(包括true/1)来使用,一般不会主动判断是否=== true/false来使用,所以对业务逻辑影响不大。
  3. mis-server的test命令增加--forceExit强制退出jest进程,暂时忽略仍有后台线程的情况。
  4. (测试无关改动)将deprecated的IdentifiableReference改为Reference

@changeset-bot
Copy link

changeset-bot bot commented Oct 14, 2023

⚠️ No Changeset found

Latest commit: d30d2d4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov
Copy link

codecov bot commented Oct 15, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (95341b2) 70.56% compared to head (d30d2d4) 70.56%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #893   +/-   ##
=======================================
  Coverage   70.56%   70.56%           
=======================================
  Files         130      130           
  Lines        3723     3723           
  Branches      498      498           
=======================================
  Hits         2627     2627           
  Misses       1001     1001           
  Partials       95       95           
Files Coverage Δ
apps/mis-server/src/entities/Account.ts 92.00% <100.00%> (ø)
apps/mis-server/src/entities/AccountWhitelist.ts 100.00% <100.00%> (ø)
apps/mis-server/src/entities/JobPriceItem.ts 100.00% <100.00%> (ø)
apps/mis-server/src/entities/StorageQuota.ts 100.00% <100.00%> (ø)
apps/mis-server/src/entities/User.ts 100.00% <100.00%> (ø)
apps/mis-server/src/entities/UserAccount.ts 100.00% <100.00%> (ø)
apps/portal-server/tests/file/utils.ts 84.28% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ddadaal ddadaal changed the title fix(tests): 尝试修复一些测试问题 fix(tests): 修复一些测试问题 Oct 15, 2023
@ddadaal ddadaal marked this pull request as ready for review October 15, 2023 11:48
@ddadaal ddadaal merged commit a77187d into master Oct 15, 2023
12 checks passed
@ddadaal ddadaal deleted the fix-tests branch October 15, 2023 11:49
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.

1 participant