File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,16 @@ describe('index.ts - Package Entry Point', () => {
2525 expect ( RouterVueModule . useLink ) . toBeDefined ( ) ;
2626 expect ( typeof RouterVueModule . useLink ) . toBe ( 'function' ) ;
2727 } ) ;
28+
29+ it ( 'should export useRouterViewDepth function' , ( ) => {
30+ expect ( RouterVueModule . useRouterViewDepth ) . toBeDefined ( ) ;
31+ expect ( typeof RouterVueModule . useRouterViewDepth ) . toBe ( 'function' ) ;
32+ } ) ;
33+
34+ it ( 'should export getRouterViewDepth function' , ( ) => {
35+ expect ( RouterVueModule . getRouterViewDepth ) . toBeDefined ( ) ;
36+ expect ( typeof RouterVueModule . getRouterViewDepth ) . toBe ( 'function' ) ;
37+ } ) ;
2838 } ) ;
2939
3040 describe ( 'Options API Exports' , ( ) => {
@@ -74,6 +84,7 @@ describe('index.ts - Package Entry Point', () => {
7484 'useProvideRouter' ,
7585 'useLink' ,
7686 'useRouterViewDepth' ,
87+ 'getRouterViewDepth' ,
7788 // Options API
7889 'getRouter' ,
7990 'getRoute' ,
@@ -100,6 +111,7 @@ describe('index.ts - Package Entry Point', () => {
100111 'useProvideRouter' ,
101112 'useLink' ,
102113 'useRouterViewDepth' ,
114+ 'getRouterViewDepth' ,
103115 'getRouter' ,
104116 'getRoute' ,
105117 'RouterLink' ,
@@ -217,6 +229,8 @@ describe('index.ts - Package Entry Point', () => {
217229 'useRoute' ,
218230 'useProvideRouter' ,
219231 'useLink' ,
232+ 'useRouterViewDepth' ,
233+ 'getRouterViewDepth' ,
220234 'getRouter' ,
221235 'getRoute'
222236 ] ;
Original file line number Diff line number Diff line change 77 useProvideRouter ,
88 useLink ,
99 useRouterViewDepth ,
10+ getRouterViewDepth ,
1011 getRoute ,
1112 getRouter
1213} from './use' ;
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ export const RouterPlugin = {
7171 * @param app Vue application instance (Vue 3) or Vue constructor (Vue 2)
7272 */
7373 install ( app : unknown ) : void {
74+ if ( ! app ) {
75+ throw new Error ( '[@esmx/router-vue] Invalid Vue app instance' ) ;
76+ }
77+
7478 const vueApp = app as VueApp ;
7579 const target = vueApp . config ?. globalProperties || vueApp . prototype ;
7680
You can’t perform that action at this time.
0 commit comments