Automated tests are broken: src/emdedWebFonts.ts
See original GitHub issueIt seems like the tests are broken after forking master and running yarn test
Expected Behavior
Test to pass.
Current Behavior
Tests fail immediately.
Possible Solution
if ('cssRules' in sheet) {
try {
toArray<CSSRule>(sheet.hasOwnProperty('cssRules')).forEach(
Looks like the code assumes hasOwnProperty returns the sheet.cssRules
instead it returns a boolean (true/false). The check just needs to be done separately.
Steps To Reproduce
yarn test
Error Message & Stack Trace
yarn run v1.22.17
$ rimraf ./test/coverage
$ karma start
25 03 2022 12:45:46.762:INFO [compiler.karma-typescript]: Compiling project using Typescript 4.4.3
25 03 2022 12:45:50.348:ERROR [compiler.karma-typescript]: src/embedWebFonts.ts(144,62): error TS2339: Property 'length' does not exist on type 'boolean'.
25 03 2022 12:45:50.348:ERROR [compiler.karma-typescript]: src/embedWebFonts.ts(173,76): error TS2339: Property 'length' does not exist on type 'boolean'.
error Command failed with exit code 1.
Additional Context
N/A
Your Environment
- html-to-image: master
- OS: macOS Monteray, zsh
- Browser: N/A
Issue Analytics
- State:
- Created a year ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Automated testing is not working - LogRocket Blog
Automated regression tests sound great in theory, and anybody starting a new job could not fail to be impressed when finding out that...
Read more >The dos and don'ts of testing automation - TechBeacon
Developing automated tests is a software development effort itself. ... tests to make sure that a code change in one feature hasn't broken...
Read more >When is a Test Case Ready for Test Automation?
This is by far the most common cause of breaking automated tests, and one which mitigating is very difficult. This is one of...
Read more >Unit Testing Best Practices: 9 to Ensure You Do It Right
There are many types of automated testing out there: front-end testing, ... their recent modifications to the code haven't broken anything.
Read more >Everything There Is To Know About Automated Testing
How is test automation changing the world? Limitations of automated testing; Benefits of automated testing; 3 levels of the testing process; What tests...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bubkoo Are you still maintaining this project? I am very curious why you have not pulled in the fix for the build, which has been broken since December.
Tests have been fixed in our fork at https://github.com/RigoCorp/html-to-image/