File tree Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ module.exports = {
12
12
"transform" : {
13
13
".*\\.(vue)$" : "<rootDir>/node_modules/@vue/vue3-jest" ,
14
14
"^.+\\.js$" : "<rootDir>/node_modules/babel-jest" ,
15
- "^.+\\.tsx?$" : "<rootDir>/node_modules/ts-jest"
15
+ "^.+\\.tsx?$" : "<rootDir>/node_modules/ts-jest" ,
16
+ '.+\\.svg$' : '<rootDir>/tests/Vue/helpers/jest-svg-component-transformer.js'
16
17
} ,
17
18
// (Optional) This file helps you later for global settings
18
19
"setupFilesAfterEnv" : [
Original file line number Diff line number Diff line change
1
+ import { mount } from '@vue/test-utils' ;
2
+ import LanguageSelector from '@/Components/LanguageSelector.vue' ;
3
+ import { createI18n } from 'vue-banana-i18n' ;
4
+
5
+ const i18n = createI18n ( {
6
+ messages : { } ,
7
+ locale : 'en' ,
8
+ wikilinks : true
9
+ } ) ;
10
+
11
+ describe ( 'LanguageSelector.vue' , ( ) => {
12
+ it ( 'renders' , ( ) => {
13
+ const wrapper = mount ( LanguageSelector , {
14
+ global : {
15
+ plugins : [ i18n ] ,
16
+ } } ) ;
17
+
18
+ expect ( wrapper . find ( '.mismatchfinder__language-selector' ) . exists ( ) ) . toBe ( true ) ;
19
+ } ) ;
20
+ } ) ;
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ process ( sourceText , sourcePath ) {
3
+ const mockComponent = {
4
+ name : sourcePath ,
5
+
6
+ template : sourceText
7
+ }
8
+
9
+ return {
10
+ code : `module.exports = ${ JSON . stringify ( mockComponent ) } ;`
11
+ }
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments