Co-authored-by: 成仕伟 <chengsw@heywhale.com>
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
Co-authored-by: Eduardo San Martin Morote <posva13@gmail.com>
createDom()
})
+ it('fails if history option is missing', () => {
+ // @ts-ignore
+ expect(() => createRouter({ routes })).toThrowError(
+ 'Provide the "history" option'
+ )
+ })
+
it('starts at START_LOCATION', () => {
const history = createMemoryHistory()
const router = createRouter({ history, routes })
let parseQuery = options.parseQuery || originalParseQuery
let stringifyQuery = options.stringifyQuery || originalStringifyQuery
let routerHistory = options.history
+ if (__DEV__ && !routerHistory)
+ throw new Error(
+ 'Provide the "history" option when calling "createRouter()":' +
+ ' https://next.router.vuejs.org/api/#history.'
+ )
const beforeGuards = useCallbacks<NavigationGuardWithThis<undefined>>()
const beforeResolveGuards = useCallbacks<NavigationGuardWithThis<undefined>>()