Remove "is-email" from testing suite#1247
Remove "is-email" from testing suite#1247arturmuller merged 3 commits intoianstormtaylor:mainfrom yeoffrey:remove-types-in-tests
Conversation
| "eslint": "^8.57.0", | ||
| "eslint-config-prettier": "^9.1.0", | ||
| "eslint-plugin-prettier": "^5.1.3", | ||
| "is-email": "^1.0.0", |
There was a problem hiding this comment.
is-email is a package that validates an email. It requires using a custom type to use, and its only used when testing refiners. Removing this allows us to remove /@types.
| export const Struct = refine(string(), 'email', isEmail) | ||
| export const Struct = refine(string(), 'email', (value) => value.includes('@')) | ||
|
|
||
| export const data = 'invalid' |
There was a problem hiding this comment.
For example, I've simply made the test for a refiner check that there is an @ symbol in the data. Since we weren't testing whether it actually works with emails, this seems simpler and within the scope of this commit.
|
Removing the All the modules under Using Vitest would also makes it a lot clearer what is actually happening with all those files -- a major plus in my book! |
is-email from testing suite
is-email from testing suite
Cool! Will keep those then. I've refactored this PR to just contain the changes for |
|
@yeoffrey FYI: I noticed that the is-email was used in the examples dir, along with some other similar helper packages. I added a small README and a custom package.json to that dir so that we can remove all of these from the root. |
No worries at all. Thanks for doing that! |
Removing
is-emailfrom the testing suite. Its used as a dev dependency only when testingrefine, and it creates some complexity because we need to type that function. Not worth it in my opinion!Related: #1244