File tree 10 files changed +3311
-2086
lines changed
10 files changed +3311
-2086
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ global.document.documentElement.style['grid-column-gap'] = true
15
15
const spy = jest . spyOn ( console , 'error' )
16
16
beforeAll ( ( ) => {
17
17
spy . mockImplementation ( ( message ) => {
18
+ // eslint-disable-next-line no-console
18
19
console . log ( message )
19
20
throw new Error ( message )
20
21
} )
Original file line number Diff line number Diff line change
1
+ // const path = require('path')
1
2
module . exports = {
2
3
collectCoverage : true ,
3
4
verbose : true ,
4
5
testEnvironment : 'jsdom' ,
5
6
preset : 'ts-jest' ,
6
7
testMatch : [ '**/__tests__/**/*.spec.[jt]s?(x)' ] ,
7
- setupFilesAfterEnv : [
8
- require . resolve ( 'jest-dom/extend-expect' ) ,
9
- './global.config.ts' ,
10
- ] ,
8
+ setupFilesAfterEnv : [ './global.config.ts' ] ,
11
9
// moduleNameMapper: process.env.TEST_ENV === 'production' ? undefined : alias,
12
10
globals : {
13
11
'ts-jest' : {
Original file line number Diff line number Diff line change 29
29
"@formily/core" : " ^2.0.0" ,
30
30
"@formily/vue" : " ^2.0.0" ,
31
31
"@vue/composition-api" : " ^1.4.0" ,
32
- "@testing-library/jest-dom" : " ^5.0.0 " ,
32
+ "@testing-library/jest-dom" : " ^5.16.1 " ,
33
33
"@testing-library/vue" : " ^5.6.2" ,
34
34
"@vue/test-utils" : " 1.0.0-beta.22" ,
35
35
"@types/jest" : " ^24.0.18" ,
50
50
"eslint-plugin-promise" : " ^4.0.0" ,
51
51
"eslint-plugin-vue" : " ^7.0.1" ,
52
52
"ghooks" : " ^2.0.4" ,
53
+ "jest" : " ^27.4.5" ,
53
54
"lint-staged" : " ^8.2.1" ,
54
55
"@commitlint/cli" : " ^14.1.0" ,
55
56
"@commitlint/prompt-cli" : " ^14.1.0" ,
56
57
"@commitlint/config-conventional" : " ^14.1.0" ,
57
58
"prettier" : " ^2.2.1" ,
58
59
"pretty-quick" : " ^3.1.0" ,
59
60
"ts-import-plugin" : " 1.6.1" ,
60
- "ts-jest" : " ^26.0.0 " ,
61
+ "ts-jest" : " ^27.1.2 " ,
61
62
"ts-node" : " ^9.1.1" ,
62
63
"lerna" : " ^4.0.0" ,
63
64
"typescript" : " ^4.1.5" ,
Original file line number Diff line number Diff line change
1
+ import { Submit } from '../submit'
2
+ import { render } from '@testing-library/vue'
3
+ import { defineComponent } from '@vue/composition-api'
4
+ import { FormProvider , Field } from '@formily/vue'
5
+ import { createForm } from '@formily/core'
6
+
7
+ test ( 'render Submit' , ( ) => {
8
+ const form = createForm ( )
9
+ render (
10
+ defineComponent ( {
11
+ name : 'TestSubmit' ,
12
+ components : {
13
+ FormProvider,
14
+ Field,
15
+ } ,
16
+ setup ( ) {
17
+ return {
18
+ form,
19
+ Submit,
20
+ }
21
+ } ,
22
+ template : `
23
+ <FormProvider :form="form">
24
+ <Field
25
+ name="aa"
26
+ :component="[Submit]"
27
+ content="提交"
28
+ />
29
+ </FormProvider>
30
+ ` ,
31
+ } )
32
+ )
33
+ expect ( form . mounted ) . toBeTruthy ( )
34
+ expect ( form . query ( 'aa' ) . take ( ) . mounted ) . toBeTruthy ( )
35
+ } )
Original file line number Diff line number Diff line change 1
1
// auto generated code
2
- import './preview-text/style.scss'
3
2
import './form-layout/style.scss'
4
3
import './form/style.scss'
5
- import './space/style.scss'
6
4
import './input/style.scss'
5
+ import './preview-text/style.scss'
6
+ import './space/style.scss'
Original file line number Diff line number Diff line change
1
+ export default { }
Original file line number Diff line number Diff line change
1
+ export default { }
Original file line number Diff line number Diff line change
1
+ export default { }
Original file line number Diff line number Diff line change
1
+ export default { }
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments