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

chore: vitest globals option 활성화 #78

Merged
merged 1 commit into from
Apr 26, 2024
Merged

Conversation

ssi02014
Copy link
Contributor

@ssi02014 ssi02014 commented Apr 25, 2024

Overview

vitest는 jest와 같이 기본적으로 global API를 활성화하지 않지만 vitest.config에서 globals 옵션을 활성화 할 수 있습니다.

이를 통해 각 테스트 파일에 직접 describe, it, expect를 import 해야되는 수고로움을 덜어 테스트 코드를 작성 시 개발자 경험을 향상시킬 수 있을 것 같습니다.

추가적으로 typescript와 함께 사용하기위해 tsconfig에 vitest/globals 을 추가 할 수 있습니다.

하지만 명시적으로 import 하는 것을 선호할 수 있습니다! 의견주시면 감사드립니다 🤗

https://vitest.dev/config/#globals

PR Checklist

  • I read and included theses actions below
  1. I have read the Contributing Guide
  2. I have written documents and tests, if needed.

Copy link

changeset-bot bot commented Apr 25, 2024

⚠️ No Changeset found

Latest commit: 9d18583

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

Copy link

vercel bot commented Apr 25, 2024

@ssi02014 is attempting to deploy a commit to the Toss Team on Vercel.

A member of the Team first needs to authorize it.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.54%. Comparing base (72c1bdd) to head (9d18583).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #78   +/-   ##
=======================================
  Coverage   97.54%   97.54%           
=======================================
  Files          13       13           
  Lines         204      204           
  Branches       45       45           
=======================================
  Hits          199      199           
  Misses          5        5           

Copy link
Member

@okinawaa okinawaa left a comment

Choose a reason for hiding this comment

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

좋습니다~!

@okinawaa okinawaa merged commit 505f432 into toss:main Apr 26, 2024
1 of 2 checks passed
@ssi02014 ssi02014 deleted the chore/test branch April 26, 2024 01:57
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.

None yet

4 participants