Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created July 24, 2018 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmiller1990/287460532914aea711df803c85dfef1f to your computer and use it in GitHub Desktop.
Save lmiller1990/287460532914aea711df803c85dfef1f to your computer and use it in GitHub Desktop.
import { shallowMount, mount, createLocalVue } from "@vue/test-utils"
import App from "@/App.vue"
import VueRouter from "vue-router"
import NestedRoute from "@/components/NestedRoute.vue"
import routes from "@/routes.js"
const localVue = createLocalVue()
localVue.use(VueRouter)
describe("App", () => {
it("renders a child component via routing", () => {
const router = new VueRouter({ routes })
const wrapper = mount(App, { localVue, router })
router.push("/nested-route")
expect(wrapper.find(NestedRoute).exists()).toBe(true)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment