File tree 2 files changed +0
-31
lines changed
2 files changed +0
-31
lines changed Original file line number Diff line number Diff line change 1
- import { showWarningNotSupported } from '../shared/constants'
2
1
import { getOptions } from '../shared/options'
3
2
import { pause , resume } from '../shared/pausing'
4
3
import refresh from '../client/refresh'
@@ -14,16 +13,6 @@ export default function _$meta(options = {}) {
14
13
* @return {Object } - injector
15
14
*/
16
15
return function $meta ( ) {
17
- if ( ! this . $root . _vueMeta ) {
18
- return {
19
- getOptions : showWarningNotSupported ,
20
- refresh : showWarningNotSupported ,
21
- inject : showWarningNotSupported ,
22
- pause : showWarningNotSupported ,
23
- resume : showWarningNotSupported
24
- }
25
- }
26
-
27
16
return {
28
17
getOptions : ( ) => getOptions ( options ) ,
29
18
refresh : _refresh . bind ( this ) ,
Original file line number Diff line number Diff line change @@ -11,26 +11,6 @@ describe('plugin', () => {
11
11
beforeEach ( ( ) => jest . clearAllMocks ( ) )
12
12
beforeAll ( ( ) => ( Vue = loadVueMetaPlugin ( ) ) )
13
13
14
- test ( 'not loaded when no metaInfo defined' , ( ) => {
15
- const warn = jest . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } )
16
-
17
- const instance = new Vue ( )
18
- expect ( instance . $meta ) . toEqual ( expect . any ( Function ) )
19
-
20
- expect ( instance . $meta ( ) . inject ) . toEqual ( expect . any ( Function ) )
21
- expect ( instance . $meta ( ) . refresh ) . toEqual ( expect . any ( Function ) )
22
- expect ( instance . $meta ( ) . getOptions ) . toEqual ( expect . any ( Function ) )
23
-
24
- expect ( instance . $meta ( ) . inject ( ) ) . not . toBeDefined ( )
25
- expect ( warn ) . toHaveBeenCalledTimes ( 1 )
26
- expect ( instance . $meta ( ) . refresh ( ) ) . not . toBeDefined ( )
27
- expect ( warn ) . toHaveBeenCalledTimes ( 2 )
28
-
29
- instance . $meta ( ) . getOptions ( )
30
- expect ( warn ) . toHaveBeenCalledTimes ( 3 )
31
- warn . mockRestore ( )
32
- } )
33
-
34
14
test ( 'is loaded' , ( ) => {
35
15
const instance = new Vue ( { metaInfo : { } } )
36
16
expect ( instance . $meta ) . toEqual ( expect . any ( Function ) )
You can’t perform that action at this time.
0 commit comments