Skip to content

Configure WebPCodec WASM path in tests#191

Merged
slimbuck merged 3 commits intoplaycanvas:mainfrom
slimbuck:tests
Mar 23, 2026
Merged

Configure WebPCodec WASM path in tests#191
slimbuck merged 3 commits intoplaycanvas:mainfrom
slimbuck:tests

Conversation

@slimbuck
Copy link
Copy Markdown
Member

Summary

  • Fix formats.test.mjs and html-output.test.mjs to explicitly set WebPCodec.wasmUrl to the local lib/webp.wasm path, resolving test failures caused by the codec being unable to locate its WASM binary in the Node.js test environment.

Changes

test/formats.test.mjs

  • Import WebPCodec from the library
  • Set WebPCodec.wasmUrl to <repo>/lib/webp.wasm at module scope

test/html-output.test.mjs

  • Add dirname/join/fileURLToPath imports for path resolution
  • Import WebPCodec from the library
  • Derive __dirname and set WebPCodec.wasmUrl to <repo>/lib/webp.wasm at module scope

Test plan

  • Run npm test and verify all format and HTML output tests pass

@slimbuck slimbuck requested a review from a team March 23, 2026 13:51
@slimbuck slimbuck self-assigned this Mar 23, 2026
@slimbuck slimbuck added the bug Something isn't working label Mar 23, 2026
@slimbuck slimbuck merged commit a40dbcd into playcanvas:main Mar 23, 2026
3 checks passed
@slimbuck slimbuck deleted the tests branch March 23, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant