1- import { mount , createLocalVue } from '@vue/test-utils'
1+ import { mount } from '@vue/test-utils'
22import TypeScript from './components/TypeScript.vue'
33import { resolve } from 'path'
44import { readFileSync } from 'fs'
5- import VueI18n from 'vue-i18n'
65import jestVue from 'vue-jest'
76import RenderFunction from './components/RenderFunction.vue'
87import Jade from './components/Jade.vue'
@@ -13,10 +12,6 @@ import { randomExport } from './components/NamedExport.vue'
1312import Coffee from './components/Coffee.vue'
1413import CoffeeScript from './components/CoffeeScript.vue'
1514import FunctionalSFCParent from './components/FunctionalSFCParent.vue'
16- import I18nJSONInline from './components/I18nJSONInline.vue'
17- import I18nJSONFromSrc from './components/I18nJSONFromSrc.vue'
18- import I18nYamlInline from './components/I18nYamlInline.vue'
19- import I18nMergingMultipleBlocks from './components/I18nMergingMultipleBlocks.vue'
2015import NoScript from './components/NoScript.vue'
2116import Pug from './components/Pug.vue'
2217import PugRelative from './components/PugRelativeExtends.vue'
@@ -130,42 +125,3 @@ test('processes SFC with no template', () => {
130125 const wrapper = mount ( RenderFunction )
131126 expect ( wrapper . is ( 'section' ) ) . toBe ( true )
132127} )
133-
134- describe ( 'I18n Processor' , ( ) => {
135- const setup = ( opts = { locale : 'en' } ) => {
136- const localVue = createLocalVue ( )
137- localVue . use ( VueI18n )
138- const i18n = new VueI18n ( opts )
139- return { i18n, localVue }
140- }
141-
142- test ( 'processes SFC with i18n JSON inline custom block' , ( ) => {
143- const { i18n, localVue } = setup ( )
144- const wrapper = mount ( I18nJSONInline , { i18n, localVue } )
145- expect ( wrapper . text ( ) ) . toBe ( 'Hello i18n in SFC!' )
146- expect ( wrapper ) . toMatchSnapshot ( )
147- } )
148-
149- test ( 'processes SFC with i18n JSON in external src attribute' , ( ) => {
150- const { i18n, localVue } = setup ( )
151- const wrapper = mount ( I18nJSONFromSrc , { i18n, localVue } )
152- expect ( wrapper . text ( ) ) . toBe ( 'Hello i18n in SFC!' )
153- expect ( wrapper ) . toMatchSnapshot ( )
154- } )
155-
156- test ( 'processes SFC with i18n Yaml Inline' , ( ) => {
157- const { i18n, localVue } = setup ( )
158- const wrapper = mount ( I18nYamlInline , { i18n, localVue } )
159- expect ( wrapper . text ( ) ) . toBe ( 'hello world!' )
160- expect ( wrapper ) . toMatchSnapshot ( )
161- } )
162-
163- test ( 'merges data blocks' , ( ) => {
164- const { i18n, localVue } = setup ( )
165- const wrapper = mount ( I18nMergingMultipleBlocks , { i18n, localVue } )
166- expect ( wrapper . text ( ) ) . toBe ( 'hello world!' )
167- expect ( typeof wrapper . vm . $t ( 'additionalKey' ) ) . toEqual ( 'string' )
168-
169- expect ( wrapper ) . toMatchSnapshot ( )
170- } )
171- } )
0 commit comments