Open
Description
What/ Why
- Current state:
preview(htmlElement)
can be used to debug reason only due to how it currently works (preview one page at a time callingpreview(htmlElement)
). - That means users are likely not to save
preview(htmlElement)
in their source code. - We can resolve this by providing a feature that saves the "snapshot" at any given time in their test code. Then they can visit
previewServer
(node_modules/.bin/jest-preview
) to see that snapshot. The API might look like the following:
import preview from 'jest-preview'
preview.debug(htmlElement, 'name-of-the-snapshot');
preview.debug(htmlElement, {name: 'name-of-the-snapshot'});
How
- Support multiple pages, not just
index.html
- Dashboard/ UI to navigate between snapshot (First time we might have
React
code in the project??)
When
- It seems like a complex feature, definitely a minor version.
- This feature can be a game-changer, since it encourage people to use
jest-preview
more. Consider prioritize it to other features such as Support CSS Modules #20 - Maybe
0.3.x
/0.4.x