From VSCode's command palette, run the Jest tools: Start jest tools command.
This will show you the Jest tools UI. The initial screen will ask you to start Jest with additional command line arguments (A custom jest reporter to capture console logs).
Then simply console.log() a html string and it will appear in the inspector.
An example usage
Logging the entire body content after rendering a component.
import { render } from '@testing-library/react';
test('should work', () => {
render(<App />);
console.log(document.body.innerHtml); // this html will appear in jest tools
});
Contributors
Thanks goes to these wonderful people (emoji key):