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

chore(test): classifies tests - changes filnename pattern for fixtures, mocks etc #557

Merged
merged 1 commit into from
Jan 10, 2022

Conversation

sverweij
Copy link
Owner

@sverweij sverweij commented Jan 10, 2022

Description, Motivation and Context

Some changes and fixes to make the developer ergonomy of the tests a bit better:

  • Adds a classification to each test suite, so it's clear whether they contain unit, integration or e2e tests.
  • Makes the classification mandatory by configuring an eslint rule for suite titles.
  • moves mocks in fixture folders to separate __mocks__ folders
  • renames fixtures folders to __fixtures__. The underscores will make it easier to distinguish them from the regular folder hierarchy.
  • Moves some mocks closer to the test in execution, so you don't have to go three folders up and to the left to get the mock, but instead can just go to the __mocks__ folder next to the test at hand.
  • adds script targets to package.json to only run e2e (test:e), integration (test:i) or unit (test:u) tests. Could save time in quick validations; e.g. test:i is fairly quick (5s) and should cover most cases already. Also unit tests are a order of magnitude faster than e2e tests (84 in 6s vs 600 in 3s).

How Has This Been Tested?

  • automated non-regression tests & green ci

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation only change
  • Refactor (non-breaking change which fixes an issue without changing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • 📖

    • My change doesn't require a documentation update, or ...
    • it does and I have updated it
  • ⚖️

    • The contribution will be subject to The MIT license, and I'm OK with that.
    • The contribution is my own original work.
    • I am ok with the stuff in CONTRIBUTING.md.

@sverweij sverweij merged commit e9478f5 into develop Jan 10, 2022
@sverweij sverweij deleted the chore/classifies-tests branch January 10, 2022 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: released
Development

Successfully merging this pull request may close these issues.

1 participant