What is snapshot testing?
Continuing from the last video, our App component test now needs an assertion. Since the only output of this component is the rendered markup, let's make an assertion about that.
We can get the rendered markup by using the html()
API method of the wrapper. Let's firstly console log that and see what it gives us.
tests/unit/client/App.vue
describe("App.vue", () => {
it("should render correctly", () => {
...
console.log(wrapper.html());
});
});
Click to load comments...