|
|
@@ -14,6 +14,11 @@ describe('Global API: use', () => {
|
|
|
Vue.use(pluginStub, options)
|
|
|
expect(Vue.options.directives['plugin-test']).toBe(def)
|
|
|
delete Vue.options.directives['plugin-test']
|
|
|
+ expect(Vue.options.directives['plugin-test']).toBeUndefined()
|
|
|
+
|
|
|
+ // should not double apply
|
|
|
+ Vue.use(pluginStub, options)
|
|
|
+ expect(Vue.options.directives['plugin-test']).toBeUndefined()
|
|
|
})
|
|
|
|
|
|
it('should apply Function plugin', () => {
|
|
|
@@ -21,4 +26,11 @@ describe('Global API: use', () => {
|
|
|
expect(Vue.options.directives['plugin-test']).toBe(def)
|
|
|
delete Vue.options.directives['plugin-test']
|
|
|
})
|
|
|
+
|
|
|
+ it('should work on extended constructors without polluting the base', () => {
|
|
|
+ const Ctor = Vue.extend({})
|
|
|
+ Ctor.use(pluginStub, options)
|
|
|
+ expect(Vue.options.directives['plugin-test']).toBeUndefined()
|
|
|
+ expect(Ctor.options.directives['plugin-test']).toBe(def)
|
|
|
+ })
|
|
|
})
|