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

test: add simple tests for configs #921

Closed
wants to merge 2 commits into from

Conversation

armano2
Copy link
Contributor

@armano2 armano2 commented Feb 1, 2020

Add simple generic tests for configs

Description

As for testing to make them generic i used jest snapshots

new tests cover configs:

  • @commitlint/config-angular
  • @commitlint/config-angular-type-enum
  • @commitlint/config-conventional

Motivation and Context

#889

Usage examples

$ jest

How Has This Been Tested?

This is adding new tests

Types of changes

  • New test cases
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@armano2 armano2 changed the title test: add simple generic config validations test: add simple tests for configs Feb 1, 2020
@marionebl
Copy link
Contributor

Thanks for contributing. Skimming through the tests this basically turns the tests red as as soon as we change anything in the tested configuration files, correct? Could you elaborate on how this helps with catching errors / improving reliability?

@armano2
Copy link
Contributor Author

armano2 commented Feb 3, 2020

those are just "simple" integration tests, that validate if configuration is correct and if rules are accepting provided options, as far as i can tell there was no way to validate tests options without using typescript.


i see that rules package got merged already and has types, it means that i could add tests that use typescript types to validate this.

@marionebl
Copy link
Contributor

i see that rules package got merged already and has types, it means that i could add tests that use typescript types to validate this.

Sounds good!

@armano2 armano2 closed this Feb 4, 2020
@armano2 armano2 deleted the config-tests branch February 4, 2020 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants