|
1 | 1 | import Vue from 'vue' |
| 2 | +import { formatComponentName } from 'core/util/debug' |
2 | 3 |
|
3 | 4 | const components = createErrorTestComponents() |
4 | 5 |
|
@@ -102,26 +103,25 @@ describe('Error handling', () => { |
102 | 103 | }) |
103 | 104 |
|
104 | 105 | it('properly format component names', () => { |
105 | | - const format = Vue.util.formatComponentName |
106 | 106 | const vm = new Vue() |
107 | | - expect(format(vm)).toBe('<Root>') |
| 107 | + expect(formatComponentName(vm)).toBe('<Root>') |
108 | 108 |
|
109 | 109 | vm.$root = null |
110 | 110 | vm.$options.name = 'hello-there' |
111 | | - expect(format(vm)).toBe('<HelloThere>') |
| 111 | + expect(formatComponentName(vm)).toBe('<HelloThere>') |
112 | 112 |
|
113 | 113 | vm.$options.name = null |
114 | 114 | vm.$options._componentTag = 'foo-bar-1' |
115 | | - expect(format(vm)).toBe('<FooBar1>') |
| 115 | + expect(formatComponentName(vm)).toBe('<FooBar1>') |
116 | 116 |
|
117 | 117 | vm.$options._componentTag = null |
118 | 118 | vm.$options.__file = '/foo/bar/baz/SomeThing.vue' |
119 | | - expect(format(vm)).toBe(`<SomeThing> at ${vm.$options.__file}`) |
120 | | - expect(format(vm, false)).toBe('<SomeThing>') |
| 119 | + expect(formatComponentName(vm)).toBe(`<SomeThing> at ${vm.$options.__file}`) |
| 120 | + expect(formatComponentName(vm, false)).toBe('<SomeThing>') |
121 | 121 |
|
122 | 122 | vm.$options.__file = 'C:\\foo\\bar\\baz\\windows_file.vue' |
123 | | - expect(format(vm)).toBe(`<WindowsFile> at ${vm.$options.__file}`) |
124 | | - expect(format(vm, false)).toBe('<WindowsFile>') |
| 123 | + expect(formatComponentName(vm)).toBe(`<WindowsFile> at ${vm.$options.__file}`) |
| 124 | + expect(formatComponentName(vm, false)).toBe('<WindowsFile>') |
125 | 125 | }) |
126 | 126 | }) |
127 | 127 |
|
|
0 commit comments