DenoDDeno
Powered by
ZweiEuroZ
Deno•13mo ago•
46 replies
ZweiEuro

Test using png mocks

When using imports with
*.png
*.png
files it will crash denos testing system with a warning:
error: Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported.
  Specifier: file:///home/zweieuro/Documents/uni/2023_SS/WUI/html_UI/vivaci_ui_deno/client/src/player_life.png
error: Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported.
  Specifier: file:///home/zweieuro/Documents/uni/2023_SS/WUI/html_UI/vivaci_ui_deno/client/src/player_life.png


While I understand the problem, how can i mock away the png and replace it with an identity object or something similar?
In jest i would transform it away (https://stackoverflow.com/questions/46898638/importing-images-breaks-jest-test) but i am not sure how deno would handle this
Stack Overflow
Importing images breaks jest test
In React components importing assets
(ex, import logo from "../../../assets/img/logo.png)
gives such error
({"Object.":function(module,exports,require,dirname,filename,global,jest){�PNG...
Importing images breaks jest test
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Deno test fails(using - superoak)
BrandonBBrandon / help
14mo ago
Running an npm-based Test Runner Using Deno?
Harsha509HHarsha509 / help
2y ago