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

Tests #46

Merged
merged 27 commits into from
Mar 28, 2024
Merged

Tests #46

merged 27 commits into from
Mar 28, 2024

Conversation

daun
Copy link
Member

@daun daun commented Mar 25, 2024

Description

  • Unit tests only
  • For this plugin, we don't really need end-to-end tests
    • Unit-testing the helpers
    • Unit-testing the plugin to make sure it calls the helpers
    • That's about as good as messing with the whole end-to-end setup and much simpler :)

Checks

  • The PR is submitted to the master branch
  • The code was linted before pushing (npm run lint)
  • All tests are passing (npm run test)
  • New or updated tests are included
  • The documentation was updated as required

@daun daun marked this pull request as ready for review March 25, 2024 23:55
@daun daun requested a review from a team March 25, 2024 23:55
@daun daun requested review from a team and removed request for a team March 26, 2024 17:09
@daun
Copy link
Member Author

daun commented Mar 26, 2024

@hirasso Ready for review :)

@daun
Copy link
Member Author

daun commented Mar 26, 2024

@hirasso Just realized this looks a bit chaotic from the diff view — I fell for the temptation of some refactoring 🤠 but most of it is related to making things testable or applying autoformatting.

Copy link
Member

@hirasso hirasso left a comment

Choose a reason for hiding this comment

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

This is all all well over my head as I haven't ever looked into the source code of head plugin and haven't got the time to do so right now – that's why my comments are only small nitpicks. Sorry for not being of more help here, but tests are always better then no tests right? 😇

tests/config/vitest.config.ts Outdated Show resolved Hide resolved
tests/unit/mergeHeadContents.test.ts Outdated Show resolved Hide resolved
@hirasso hirasso self-requested a review March 26, 2024 21:57
hirasso
hirasso previously approved these changes Mar 26, 2024
@daun daun requested a review from hirasso March 27, 2024 11:59
@hirasso
Copy link
Member

hirasso commented Mar 27, 2024

@daun did you test the latest @swup/cli swup package:format with this, formatting the tests and readme.md additionally to the source code? 🙂

@daun
Copy link
Member Author

daun commented Mar 27, 2024

@hirasso I think so?

@daun
Copy link
Member Author

daun commented Mar 27, 2024

@hirasso Looks like that's what happened, but I don't remember 🤠

Copy link
Member

@hirasso hirasso left a comment

Choose a reason for hiding this comment

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

🧪

@daun daun merged commit b857b71 into master Mar 28, 2024
1 check passed
@daun daun deleted the tests branch March 28, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants