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

Replace karma with vitest #665

Merged
merged 7 commits into from
Oct 13, 2023
Merged

Replace karma with vitest #665

merged 7 commits into from
Oct 13, 2023

Conversation

hackerwins
Copy link
Member

@hackerwins hackerwins commented Oct 12, 2023

What this PR does / why we need it?

This is a PR for revising the codes included in #655.

Switching test framework to vitest from karma.

karma is deprecated and no longer maintained and It's hard to configure and slower than other modern test frameworks. vitest is one of the fastest modern testing frameworks and can be used with a near-zero configuration, that is why I chose it.

for this pull request, I did the following things:

  • Changes from feat: switching test framework to vitest #655 (9a17ca2)
    • karma, mocha, sinon and chai are removed and replaced with vitest
    • Changed to use vi.fn() instead of sinon.spy()
    • Changed to use vi.fn().mockImplementation instead of sinon.stub().callsFake()
    • Changed to use task.name instead of this.test!.title (to get the title of current test)
    • Changed to inject the yorkie rpc address for testing as an environment variable
  • Fixed XMLHttpRequest mock. not using sinon anymore (ea879a2)
  • Using a customized jsdom Vitest environment to prevent the implementation of the Uint8Array from being overwritten via jsdom (c8eb684)

Any background context you want to provide?

What are the relevant tickets?

Fixes #654

Checklist

  • Added relevant tests or not required
  • Didn't break anything

@hackerwins hackerwins changed the title Blurfx feat/vitest Replace karma with vitest Oct 13, 2023
@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (0eaab11) 89.16% compared to head (14b15e9) 71.33%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #665       +/-   ##
===========================================
- Coverage   89.16%   71.33%   -17.84%     
===========================================
  Files          79       58       -21     
  Lines        9318     8734      -584     
  Branches      856      784       -72     
===========================================
- Hits         8308     6230     -2078     
- Misses        697     2245     +1548     
+ Partials      313      259       -54     
Files Coverage Δ
src/document/presence/presence.ts 100.00% <ø> (ø)
src/client/client.ts 75.34% <66.66%> (+0.26%) ⬆️

... and 42 files with indirect coverage changes

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

@hackerwins hackerwins merged commit c4938f7 into main Oct 13, 2023
@hackerwins hackerwins deleted the blurfx-feat/vitest branch October 13, 2023 04:07
@blurfx blurfx mentioned this pull request Oct 13, 2023
2 tasks
@hackerwins hackerwins mentioned this pull request Jul 9, 2024
2 tasks
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.

Suggestion: migrate karma to a another test framework
2 participants