commit | a60ef18165902074dc5e90a1390a91ff2a6b4f94 | [log] [tgz] |
---|---|---|
author | Primiano Tucci <primiano@google.com> | Fri Jun 11 15:37:12 2021 +0100 |
committer | Primiano Tucci <primiano@google.com> | Fri Jun 11 15:52:18 2021 +0000 |
tree | b95d827d43e0fd87cf81d3a6d3759332b97657e6 | |
parent | 278ee2bbe61232ce6a9737e83f0c3dd1f5c76a62 [diff] |
ui: Make all unitests to jsdom-based Today UI tests are a mixture of nodejs-based tests and jsdom-based tests (without counting headless, which I am going to rewrite next). That creates unnecessary confusion and makes tests harder to write. The real issue is that some parts of the codebase (the code under tests) sometimes depends on DOM elements like window.localstorage and the like. Running them in a clean Node environment adds unnecessary boilerplate. Today we have a mixture of tests that do hacks to run in both DOM and Node environment (e.g., string_utils.ts) and tests that give up and use the jsdom environment. This CL gives up on all of them and uses jsdom everywhere for consistency. For now I am leaving the _unittest.ts vs _jsdom.ts suffix and I am merging everything at the jest.config level. If this CL sticks, will rename jsdom -> unittests in a follow-up CL. This CL also fixes the build.js script when using --watch: today the HTTP server and the tests are started straight away after the end of the tasks, but in --watch mode that's too early because tsc and rollup happen asynchronously. Bug: 190075400 Change-Id: I6ef8060e32924417b612c1010ae206cf4b6671c1
Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.
See https://perfetto.dev/docs or the /docs/ directory for documentation.