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

[Test] Add Dragon Cheer tests #4013

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

torranx
Copy link
Collaborator

@torranx torranx commented Sep 3, 2024

What are the changes the user will see?

none

Why am I making these changes?

adding tests to #3959 now that it is possible

What are the changes from a developer perspective?

dragon cheer test

Screenshots/Videos

How to test the changes?

npm run test dragon_cheer

Checklist

  • I'm using beta as my base branch
  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
  • Have I provided a clear explanation of the changes?
  • Have I considered writing automated tests for the issue?
  • If I have text, did I make it translatable and add a key in the English locale file(s)?
  • Have I tested the changes (manually)?
    • Are all unit tests still passing? (npm run test)
  • Are the changes visual?
    • Have I provided screenshots/videos of the changes?

@torranx torranx requested a review from a team as a code owner September 3, 2024 23:14
@flx-sta
Copy link
Collaborator

flx-sta commented Sep 3, 2024

I know tests are sometimes redundant but some of those seem like they could be merged. especially the first few lines are almost identical and could be put into beforeEach() while exposting the properly variables in the correct scope (of describe)

@torranx
Copy link
Collaborator Author

torranx commented Sep 3, 2024

I know tests are sometimes redundant but some of those seem like they could be merged. especially the first few lines are almost identical and could be put into beforeEach() while exposting the properly variables in the correct scope (of describe)

when you say "first few lines", I'm assuming these:

await game.classicMode.startBattle([Species.DRAGONAIR, Species.MAGIKARP]);

const magikarp = game.scene.getPlayerField()[1];
const enemy = game.scene.getEnemyField()[0];

vi.spyOn(enemy, "getCritStage");

game.move.select(Moves.DRAGON_CHEER, 0);
game.move.select(Moves.TACKLE, 1, BattlerIndex.ENEMY);

you cant get the pokemon without starting the battle first

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
@flx-sta flx-sta added the Tests Automated tests related label Sep 4, 2024
@flx-sta
Copy link
Collaborator

flx-sta commented Sep 4, 2024

@torranx I mean you can start the battle in beforeEach() too. That's what I meant

@torranx
Copy link
Collaborator Author

torranx commented Sep 4, 2024

@torranx I mean you can start the battle in beforeEach() too. That's what I meant

that would require setting the beforeEach()'s callback to be async, will that not cause side effects?

DayKev
DayKev previously approved these changes Sep 4, 2024
src/test/moves/dragon_cheer.test.ts Outdated Show resolved Hide resolved
@frutescens frutescens added this pull request to the merge queue Sep 5, 2024
Merged via the queue into pagefaultgames:beta with commit 39f3572 Sep 5, 2024
4 checks passed
@torranx torranx deleted the test/dragon_cheer branch October 4, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tests Automated tests related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants