Skip to content

Conversation

@odzhychko
Copy link
Contributor

In tests, some stores were not recreated before each test. They broke when running them in a random order.
This could be achieved by running npx vitest --run --sequence.shuffle.

Properly recreating stores also allowed refactoring the tests to make them more clear.

In tests, some stores were not recreated before each test.
They broke when running them in a random order.
This could be achieved by running `npx vitest --run  --sequence.shuffle`.

Properly recreating stores also allowed refactoring the tests to make them more clear.

Signed-off-by: Oleksandr Dzhychko <hey@oleks.dev>
@odzhychko odzhychko force-pushed the eliminate-test-relying-on-order branch from 5fb528f to 02406f5 Compare January 31, 2026 09:47
@SebastianKrupinski
Copy link
Contributor

Hi @odzhychko

Thank you for the PR, what issue is this meant to address? Is there a ticket?

@odzhychko
Copy link
Contributor Author

Hi @SebastianKrupinski , thanks for looking at it.

The issue these changes adress:

  • The modified tests are now more robust because they do not rely on the execution order of test cases.
    • Adding new test cases or modifying existing ones will be easier and less error-prone.
    • Each test case can be understood without looking at the other test cases.
  • They are more consistent with the other tests for the store.
    • The others already recreated Pinia before each test case.

If you do not find this useful (at the moment), feel free to close it. I didn't create a ticket because it's only a refactoring of tests and explaining the issue with already proposed code seemed the best approach. Let me know if I should create a ticket for this. I wasn't sure anyway how to best approach such contributions.

@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@SebastianKrupinski SebastianKrupinski left a comment

Choose a reason for hiding this comment

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

Improved test are always a good thing

@SebastianKrupinski SebastianKrupinski merged commit 56a734b into nextcloud:main Feb 2, 2026
45 of 47 checks passed
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