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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: vitest prefer-each #2144

Merged
merged 21 commits into from May 20, 2023
Merged

test: vitest prefer-each #2144

merged 21 commits into from May 20, 2023

Conversation

Shinigami92
Copy link
Member

@Shinigami92 Shinigami92 commented May 9, 2023

references #2098 (comment)

TODOs and Notes for myself

  • we should check if we need to set the seed in a setup block, because it might be that the description title is not executed again
    • right now I assume the repeats might handle the faker instance differently than the previous for-loop, but I need to check that
  • the global unique was/is repeated 馃 how does it behave if the seed gets reset? does this affect the global store? did we fixed it now accidentally via faker instance store?

Helpful docs to understand the .each string syntax: https://vitest.dev/api/#test-each

For debugging purposes it can help quite a log to set reporters: 'verbose' in vitest config!

@codecov
Copy link

codecov bot commented May 9, 2023

Codecov Report

Merging #2144 (1c97296) into next (06bc5af) will decrease coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2144      +/-   ##
==========================================
- Coverage   99.59%   99.59%   -0.01%     
==========================================
  Files        2607     2607              
  Lines      244977   244977              
  Branches     1148     1149       +1     
==========================================
- Hits       243997   243993       -4     
- Misses        953      957       +4     
  Partials       27       27              

see 2 files with indirect coverage changes

@Shinigami92 Shinigami92 requested a review from ST-DDT May 9, 2023 13:14
@Shinigami92
Copy link
Member Author

@ST-DDT could you have a first look and re-evaluate if I did not made any mistakes?

test/color.spec.ts Outdated Show resolved Hide resolved
test/helpers.spec.ts Show resolved Hide resolved
@Shinigami92
Copy link
Member Author

I'm now experimenting a bit with the repeats and it looks like that the "string" description title does not get executed again (as assumed).
So we need to move the seed() into a beforeAll or we need to use describe.each.
I think beforeAll is more clear (but sadly more verbose) here

@Shinigami92 Shinigami92 added the s: on hold Blocked by something or frozen to avoid conflicts label May 9, 2023
@Shinigami92
Copy link
Member Author

Shinigami92 commented May 9, 2023

blocked by vitest-dev/vitest#3334

we will use the "old" strategy for now

@Shinigami92 Shinigami92 removed the s: on hold Blocked by something or frozen to avoid conflicts label May 9, 2023
@Shinigami92 Shinigami92 requested a review from ST-DDT May 9, 2023 21:22
test/locale-data.spec.ts Outdated Show resolved Hide resolved
Co-authored-by: ST-DDT <ST-DDT@gmx.de>
@Shinigami92 Shinigami92 marked this pull request as ready for review May 9, 2023 21:33
test/all_functional.spec.ts Outdated Show resolved Hide resolved
test/all_functional.spec.ts Outdated Show resolved Hide resolved
test/all_functional.spec.ts Outdated Show resolved Hide resolved
test/location.spec.ts Outdated Show resolved Hide resolved
test/mersenne.spec.ts Outdated Show resolved Hide resolved
test/mersenne.spec.ts Outdated Show resolved Hide resolved
Shinigami92 and others added 3 commits May 10, 2023 08:15
Co-authored-by: ST-DDT <ST-DDT@gmx.de>
Co-authored-by: ST-DDT <ST-DDT@gmx.de>
@Shinigami92 Shinigami92 requested a review from ST-DDT May 10, 2023 06:42
test/mersenne.spec.ts Outdated Show resolved Hide resolved
Shinigami92 and others added 2 commits May 10, 2023 09:14
Co-authored-by: ST-DDT <ST-DDT@gmx.de>
Co-authored-by: ST-DDT <ST-DDT@gmx.de>
@Shinigami92 Shinigami92 requested a review from ST-DDT May 10, 2023 07:25
@ST-DDT ST-DDT requested review from a team May 10, 2023 07:49
@Shinigami92 Shinigami92 enabled auto-merge (squash) May 20, 2023 08:53
@Shinigami92 Shinigami92 merged commit 614fd67 into next May 20, 2023
20 checks passed
@Shinigami92 Shinigami92 deleted the vitest-prefer-each branch May 20, 2023 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants