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

refactor: string schema tests #366

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ariskemper
Copy link
Contributor

No description provided.

@fabian-hiller fabian-hiller added enhancement New feature or request priority This has priority labels Jan 14, 2024
@ariskemper
Copy link
Contributor Author

@fabian-hiller ready for review and merge?

@@ -83,17 +83,17 @@ describe('stringAsync', () => {
describe('schema pipeline', () => {
const schema1 = stringAsync([minLength(2), maxLength(3)]);

test('should contain invalid length message, type and requirements', () => {
test('should expose the pipeline', () => {
Copy link
Owner

Choose a reason for hiding this comment

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

I would refactor that and test the entire schema object for the different arguments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fabian-hiller so you would like to add more tests for using different arguments, validations ( minLength, maxLength, bic, creditCard .... ) or entire schema properties?

Copy link
Owner

Choose a reason for hiding this comment

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

I would not distinguish between different pipeline actions. As you can see in the API reference, string allows you to pass no argument, only a pipeline or a message and a pipeline. I would just test each combination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority This has priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants