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

Add example of schema validation test with Joi #44

Merged
merged 1 commit into from Aug 24, 2022

Conversation

stefanteixeira
Copy link
Owner

Description

Adding a simple schema validation test with Joi, to demonstrate how it can be done. Also, removing expect-playwright lib, which was unnecessary (closes #42)

How to test

  • yarn install
  • yarn api:start
  • yarn test:api

Checklist

  • Branch name follows the pattern: concise-feature-description
  • PR has a descriptive name
  • PR branch is up-to-date with main (if not, rebase it)
  • Double-check the quality of commit messages

@stefanteixeira stefanteixeira self-assigned this Aug 20, 2022
@uLucasFraga uLucasFraga added the ready to review This PR is ready to be reviewed label Aug 24, 2022
Copy link
Collaborator

@uLucasFraga uLucasFraga left a comment

Choose a reason for hiding this comment

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

@stefanteixeira Would you find it interesting to have a folder just for schemas?

For example:

  • api/schemas
  • e2e

or:

  • api
  • schemas
  • e2e
  • visual

Because I think it would be easier to increase testing and your maintenance (if necessary).
Ah...and to separate a job for schema test.

@stefanteixeira
Copy link
Owner Author

@uLucasFraga I wouldn't split this schema validation from API tests because they rely on the same structure and are an API test anyways.

Regarding having a separate place for schemas, it's definitely worth it 👍
I'll move it to lib/schemas.js for now and import in the API test added in the PR, WDYT?

@uLucasFraga
Copy link
Collaborator

LGTM! 🐐

@uLucasFraga uLucasFraga self-requested a review August 24, 2022 19:17
@stefanteixeira stefanteixeira merged commit 6638139 into main Aug 24, 2022
@stefanteixeira stefanteixeira deleted the add-schema-validation-example branch August 24, 2022 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to review This PR is ready to be reviewed
Projects
New features
Awaiting triage
Development

Successfully merging this pull request may close these issues.

Remove expect-playwright library
2 participants