-
-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #919 from EltonLobo07/feat/add-values-and-not_valu…
…es-actions add `values` and `notValues` actions
- Loading branch information
Showing
47 changed files
with
2,430 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './notValues.ts'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { describe, expectTypeOf, test } from 'vitest'; | ||
import type { InferInput, InferIssue, InferOutput } from '../../types/index.ts'; | ||
import { | ||
notValues, | ||
type NotValuesAction, | ||
type NotValuesIssue, | ||
} from './notValues.ts'; | ||
|
||
describe('notValues', () => { | ||
describe('should return action object', () => { | ||
test('with undefined message', () => { | ||
type Action = NotValuesAction<number, [7, 12], undefined>; | ||
expectTypeOf(notValues<number, [7, 12]>([7, 12])).toEqualTypeOf<Action>(); | ||
expectTypeOf( | ||
notValues<number, [7, 12], undefined>([7, 12], undefined) | ||
).toEqualTypeOf<Action>(); | ||
}); | ||
|
||
test('with string message', () => { | ||
expectTypeOf( | ||
notValues<number, [7, 12], 'message'>([7, 12], 'message') | ||
).toEqualTypeOf<NotValuesAction<number, [7, 12], 'message'>>(); | ||
}); | ||
|
||
test('with function message', () => { | ||
expectTypeOf( | ||
notValues<number, [7, 12], () => string>([7, 12], () => 'message') | ||
).toEqualTypeOf<NotValuesAction<number, [7, 12], () => string>>(); | ||
}); | ||
}); | ||
|
||
describe('should infer correct types', () => { | ||
type Action = NotValuesAction<number, [7, 12], undefined>; | ||
|
||
test('of input', () => { | ||
expectTypeOf<InferInput<Action>>().toEqualTypeOf<number>(); | ||
}); | ||
|
||
test('of output', () => { | ||
expectTypeOf<InferOutput<Action>>().toEqualTypeOf<number>(); | ||
}); | ||
|
||
test('of issue', () => { | ||
expectTypeOf<InferIssue<Action>>().toEqualTypeOf< | ||
NotValuesIssue<number, [7, 12]> | ||
>(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.