File tree Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 77} from './validators'
88import { VUE_VERSION } from './consts'
99import { compileTemplateForSlots } from './compile-template'
10- import { throwError , warn } from './util'
10+ import { throwError , warnDeprecated } from './util'
1111import { validateSlots } from './validate-slots'
1212
1313function vueExtendUnsupportedOption ( option ) {
@@ -34,7 +34,7 @@ export function validateOptions(options, component) {
3434 )
3535 }
3636 if ( 'attachToDocument' in options ) {
37- warn (
37+ warnDeprecated (
3838 `options.attachToDocument is deprecated in favor of options.attachTo and will be removed in a future release`
3939 )
4040 }
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ describeWithShallowAndMount('config', mountingMethod => {
101101 expect ( wrapper . find ( '[data-testid="expanded"]' ) . exists ( ) ) . to . equal ( false )
102102 } )
103103
104- it ( 'allows control deprecation warnings visibility' , ( ) => {
104+ it ( 'allows control deprecation warnings visibility for name method ' , ( ) => {
105105 config . showDeprecationWarnings = true
106106 const Component = {
107107 name : 'Foo' ,
@@ -114,4 +114,34 @@ describeWithShallowAndMount('config', mountingMethod => {
114114 wrapper . name ( )
115115 expect ( console . error ) . to . have . callCount ( 1 )
116116 } )
117+
118+ describe ( 'attachToDocument deprecation warning' , ( ) => {
119+ const Component = {
120+ name : 'Foo' ,
121+ template : '<div>Foo</div>'
122+ }
123+
124+ it ( 'should show warning if config is enabled' , ( ) => {
125+ config . showDeprecationWarnings = true
126+
127+ mountingMethod ( Component , {
128+ attachToDocument : true
129+ } )
130+ expect ( console . error ) . to . be . calledWith (
131+ sandbox . match ( 'attachToDocument is deprecated' )
132+ )
133+ } )
134+
135+ it ( 'should not show warning if config is disabled' , ( ) => {
136+ config . showDeprecationWarnings = false
137+
138+ mountingMethod ( Component , {
139+ attachToDocument : true
140+ } )
141+
142+ expect ( console . error ) . not . to . be . calledWith (
143+ sandbox . match ( 'attachToDocument is deprecated' )
144+ )
145+ } )
146+ } )
117147} )
You can’t perform that action at this time.
0 commit comments