react-native-mmkv icon indicating copy to clipboard operation
react-native-mmkv copied to clipboard

feat: add automocking in vitest

Open dcdms opened this issue 1 year ago • 3 comments

react-native-mmkv already has automocking for Jest, but not for Vitest.

This commit adds automocking for Vitest test environments just by checking if the VITEST_WORKER_ID environment variable is present.

This new functionality was also documented in the README, in the "Testing with Jest or Vitest" section, formerly the "Testing with Jest" section.

This way, MMKV will be mocked in both Jest and Vitest test environments.

dcdms avatar Apr 24 '24 00:04 dcdms

Interesting, thanks for your PR!

Changes look good, but do people actually use Vitest in RN apps?

mrousavy avatar Apr 29 '24 10:04 mrousavy

Changes look good, but do people actually use Vitest in RN apps?

This package was created to integrate React Native and Vitest, so I am using them together.

About the error during CI, this appears to be an error in the integration between Eslint and Prettier. I will fix this.

dcdms avatar Apr 29 '24 11:04 dcdms

Oops! I'll see what went wrong and fix it.

dcdms avatar Apr 29 '24 14:04 dcdms

Thank you!

mrousavy avatar Apr 30 '24 09:04 mrousavy