Skip to content

Commit

Permalink
Use more idiomatic Vitest in the testing suite (#1245)
Browse files Browse the repository at this point in the history
* Use vitest except where possible and organize tests

* Use vi.fn() instead of CallTracker in 'deprecated' helper

- CallTracker has been deprecated in Node.js
- vi.fn() is probably more familiar to Vitest users

---------

Co-authored-by: Artur Müller <[email protected]>
  • Loading branch information
yeoffrey and arturmuller committed Jun 21, 2024
1 parent 625cea5 commit cb3bb0d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"is-email": "^1.0.0",
"is-url": "^1.2.4",
"is-uuid": "^1.0.2",
"lodash": "^4.17.15",
Expand Down
3 changes: 0 additions & 3 deletions test/@types/is-email.d.ts

This file was deleted.

3 changes: 1 addition & 2 deletions test/validation/refine/invalid.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import isEmail from 'is-email'
import { string, refine } from '../../../src'

export const Struct = refine(string(), 'email', isEmail)
export const Struct = refine(string(), 'email', (value) => value.includes('@'))

export const data = 'invalid'

Expand Down
3 changes: 1 addition & 2 deletions test/validation/refine/valid.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import isEmail from 'is-email'
import { string, refine } from '../../../src'

export const Struct = refine(string(), 'email', isEmail)
export const Struct = refine(string(), 'email', (value) => value.includes('@'))

export const data = '[email protected]'

Expand Down

0 comments on commit cb3bb0d

Please sign in to comment.