File tree Expand file tree Collapse file tree 5 files changed +3442
-2
lines changed Expand file tree Collapse file tree 5 files changed +3442
-2
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "presets" : [
3
+ [" env" , { "modules" : false }]
4
+ ],
5
+ "env" : {
6
+ "test" : {
7
+ "presets" : [
8
+ [" env" , { "targets" : { "node" : " current" }}]
9
+ ]
10
+ }
11
+ }
12
+ }
Original file line number Diff line number Diff line change 4
4
"description" : " Mobile-friendly picture file input component with image preview and drag and drop." ,
5
5
"main" : " PictureInput.vue" ,
6
6
"scripts" : {
7
- "test" : " npm run unit "
7
+ "test" : " jest "
8
8
},
9
9
"repository" : {
10
10
"type" : " git" ,
24
24
"bugs" : {
25
25
"url" : " https://github.com/alessiomaffeis/vue-picture-input/issues"
26
26
},
27
- "homepage" : " https://github.com/alessiomaffeis/vue-picture-input"
27
+ "homepage" : " https://github.com/alessiomaffeis/vue-picture-input" ,
28
+ "devDependencies" : {
29
+ "@vue/test-utils" : " ^1.0.0-beta.12" ,
30
+ "babel-core" : " ^6.26.0" ,
31
+ "babel-preset-env" : " ^1.6.1" ,
32
+ "jest" : " ^22.4.0" ,
33
+ "jest-serializer-vue" : " ^0.3.0" ,
34
+ "vue" : " ^2.5.13" ,
35
+ "vue-jest" : " ^2.1.0" ,
36
+ "vue-server-renderer" : " ^2.5.13" ,
37
+ "vue-template-compiler" : " ^2.5.13"
38
+ },
39
+ "jest" : {
40
+ "moduleFileExtensions" : [
41
+ " js" ,
42
+ " vue"
43
+ ],
44
+ "moduleNameMapper" : {
45
+ "^@/(.*)$" : " <rootDir>/src/$1"
46
+ },
47
+ "transform" : {
48
+ "^.+\\ .js$" : " <rootDir>/node_modules/babel-jest" ,
49
+ ".*\\ .(vue)$" : " <rootDir>/node_modules/vue-jest"
50
+ },
51
+ "snapshotSerializers" : [
52
+ " <rootDir>/node_modules/jest-serializer-vue"
53
+ ]
54
+ }
28
55
}
Original file line number Diff line number Diff line change
1
+ import { shallow } from '@vue/test-utils'
2
+ import { createRenderer } from 'vue-server-renderer'
3
+
4
+ import PictureInput from '../PictureInput.vue'
5
+
6
+ describe ( 'PictureInput.vue' , ( ) => {
7
+ it ( 'matches snapshot' , ( ) => {
8
+ const renderer = createRenderer ( )
9
+ const wrapper = shallow ( PictureInput )
10
+ renderer . renderToString ( wrapper . vm , ( err , str ) => {
11
+ if ( err ) throw new Error ( err )
12
+ expect ( str ) . toMatchSnapshot ( )
13
+ } )
14
+ } )
15
+ } )
Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports [` PictureInput.vue matches snapshot 1` ] = `
4
+ <div id = " picture-input" class = " picture-input" >
5
+ <div >
6
+ <button class = " btn btn-primary button" >Select a Photo</button >
7
+ </div >
8
+ <input type = " file" accept = " image/*" >
9
+ </div >
10
+ `;
You can’t perform that action at this time.
0 commit comments