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

add asset tests #9802

Merged
merged 3 commits into from
Nov 1, 2023
Merged

add asset tests #9802

merged 3 commits into from
Nov 1, 2023

Conversation

achamas-playco
Copy link
Collaborator

@achamas-playco achamas-playco commented Oct 30, 2023

πŸ€– Generated by Copilot at 132ea06

Summary

πŸ›πŸššβœ…

This pull request adds and updates unit tests for the Assets, Cache, and Loader classes, and fixes a bug in the Resolver class. It also refactors some of the test files and utility functions to improve readability and avoid duplication. The main files affected are tests/assets/*.tests.ts, tests/utils/async.ts, src/assets/resolver/Resolver.ts, and tests/app/Application.tests.ts.

Assets and Cache
Improved with tests and parsers
Winter bug fixing

Walkthrough

  • Fix bug in Resolver class for assets with query parameters (link)
  • Refactor async utility functions to tests/utils/async.ts and update import paths (link, link, link)
  • Refactor basePath constant to tests/assets/basePath.ts and update import paths (link, link)
  • Add unit tests for Assets class related to asset bundles, video assets, detection parsers, and unresolved assets (link, link, link, link)
  • Add unit tests for Cache class related to custom parsers (link)
  • Add unit tests for Loader class related to loading and unloading different types of assets (link)
  • Add unit tests for loadWebFont function related to loading and unloading web fonts (link)
  • Add unit tests for createStringVariations function related to generating string variations from template strings (link)
  • Add sample asset manifest to tests/assets/sampleManifest.ts for testing asset bundles (link)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 30, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4a7e33b:

Sandbox Source
pixi.js-sandbox Configuration

@Zyie Zyie added this to the v8.0.0-beta.7 milestone Oct 30, 2023
@Zyie Zyie modified the milestones: v8.0.0-beta.7, v8.0.0-beta.8 Oct 31, 2023
Copy link
Member

@GoodBoyDigital GoodBoyDigital left a comment

Choose a reason for hiding this comment

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

this looks good! letf one comment about the format containing query params. Can we look into that please?

Other than that PR is great!

// note: if the key is "format" and there are query params,
// then "format" will contain the query params as well,
// so we check inclusion rather than strict equality
return typeof priorityValue === 'string'
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be better to fix the format? It should ideally be stripped of query params before it gets to here? cc @Zyie does that sound about right?

Copy link
Member

Choose a reason for hiding this comment

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

yeah format shouldn't have a query param on it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok wasn't sure if that was intended behavior so didn't change current state. Will fix.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed, moved extension parsing to small util function, tested that. Reverted bug workaround.

@achamas-playco achamas-playco merged commit ce432ca into next-v8 Nov 1, 2023
3 checks passed
@achamas-playco achamas-playco deleted the chore/v8-tests-assets branch November 1, 2023 02:16
@Zyie Zyie added the Backport to v7 PR should be back ported to the v7 branch label Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport to v7 PR should be back ported to the v7 branch v8
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants