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

♻️ Enable specifying version in argument parser test cases #1216

Conversation

TheAfroOfDoom
Copy link
Contributor

Summary

Closes #1215

really just refactoring. there was a mistake where we were only passing in the meta property to the project when running testParser. passing in the whole project object allowed us to also pass-in the desired loadedVersion

https://github.com/TheAfroOfDoom/Spyglass/blob/6103be7f90eb5583997ae14e28c807e156e63b3e/packages/java-edition/test/mcfunction/parser/argument.spec.ts#L323-L328


I also added some tests for the 1.20.5+ particle parser. not sure if the snapshots look as expected? leaving that to you @misode

i feel like i'm expecting them to raise some errors or something, but not seeing any..

here's some visuals

1.15
1215-refactor-arg-parser-tests
1.20.6
image

- tests don't include version in name if it's `1.15` (default) to minimize diffs here
@TheAfroOfDoom TheAfroOfDoom requested a review from misode May 30, 2024 01:52
@TheAfroOfDoom TheAfroOfDoom requested a review from misode May 30, 2024 02:11
@TheAfroOfDoom TheAfroOfDoom changed the title ♻️ Allow specifying version in argument parser test cases ♻️ Enable specifying version in argument parser test cases May 31, 2024
Copy link
Contributor

@Calverin Calverin left a comment

Choose a reason for hiding this comment

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

Looks good to me, being able to set different versions for each test is a nice change 👍

@MulverineX MulverineX merged commit e588c53 into SpyglassMC:main May 31, 2024
3 checks passed
@TheAfroOfDoom TheAfroOfDoom deleted the 1215-refactor-argument-parser-unit-tests branch May 31, 2024 06:03
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.

Support testing multiple versions in argument parser tests
5 participants