File tree Expand file tree Collapse file tree 10 files changed +3311
-2086
lines changed
Expand file tree Collapse file tree 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
1515 const spy = jest . spyOn ( console , 'error' )
1616 beforeAll ( ( ) => {
1717 spy . mockImplementation ( ( message ) => {
18+ // eslint-disable-next-line no-console
1819 console . log ( message )
1920 throw new Error ( message )
2021 } )
Original file line number Diff line number Diff line change 1+ // const path = require('path')
12module . exports = {
23 collectCoverage : true ,
34 verbose : true ,
45 testEnvironment : 'jsdom' ,
56 preset : 'ts-jest' ,
67 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' ] ,
119 // moduleNameMapper: process.env.TEST_ENV === 'production' ? undefined : alias,
1210 globals : {
1311 'ts-jest' : {
Original file line number Diff line number Diff line change 2929 "@formily/core" : " ^2.0.0" ,
3030 "@formily/vue" : " ^2.0.0" ,
3131 "@vue/composition-api" : " ^1.4.0" ,
32- "@testing-library/jest-dom" : " ^5.0.0 " ,
32+ "@testing-library/jest-dom" : " ^5.16.1 " ,
3333 "@testing-library/vue" : " ^5.6.2" ,
3434 "@vue/test-utils" : " 1.0.0-beta.22" ,
3535 "@types/jest" : " ^24.0.18" ,
5050 "eslint-plugin-promise" : " ^4.0.0" ,
5151 "eslint-plugin-vue" : " ^7.0.1" ,
5252 "ghooks" : " ^2.0.4" ,
53+ "jest" : " ^27.4.5" ,
5354 "lint-staged" : " ^8.2.1" ,
5455 "@commitlint/cli" : " ^14.1.0" ,
5556 "@commitlint/prompt-cli" : " ^14.1.0" ,
5657 "@commitlint/config-conventional" : " ^14.1.0" ,
5758 "prettier" : " ^2.2.1" ,
5859 "pretty-quick" : " ^3.1.0" ,
5960 "ts-import-plugin" : " 1.6.1" ,
60- "ts-jest" : " ^26.0.0 " ,
61+ "ts-jest" : " ^27.1.2 " ,
6162 "ts-node" : " ^9.1.1" ,
6263 "lerna" : " ^4.0.0" ,
6364 "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 11// auto generated code
2- import './preview-text/style.scss'
32import './form-layout/style.scss'
43import './form/style.scss'
5- import './space/style.scss'
64import './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