Auto mock based on Typescript interface

This commit is contained in:
Ricardo Ambrogi
2020-04-22 13:30:12 +02:00
parent e521c53f2c
commit 0f92235ac5
5 changed files with 271 additions and 334 deletions

1
config.ts Normal file
View File

@@ -0,0 +1 @@
import "jest-ts-auto-mock"

View File

@@ -28,6 +28,7 @@ module.exports = {
coveragePathIgnorePatterns: [
"<rootDir>/src/typings"
],
setupFiles: ["<rootDir>config.ts"],
unmockedModulePathPatterns: [
"/dist"
],
@@ -37,5 +38,13 @@ module.exports = {
testPathIgnorePatterns : [
"/node_modules",
"/dist"
]
],
transform: {
".ts": "ts-jest"
},
globals: {
"ts-jest": {
compiler: "ttypescript"
}
}
};

View File

@@ -47,12 +47,15 @@
"coveralls": "3.0.11",
"eslint": "6.8.0",
"jest": "25.4.0",
"jest-ts-auto-mock": "^1.0.11",
"kind-of": "^6.0.3",
"minimist": ">=1.2.3",
"nock": "12.0.3",
"release-it": "13.5.4",
"ts-auto-mock": "^1.6.0",
"ts-jest": "25.4.0",
"ts-loader": "7.0.1",
"ttypescript": "^1.5.10",
"typescript": "3.8.3",
"webpack": "4.42.1",
"webpack-cli": "3.3.11"

View File

@@ -18,7 +18,8 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"noUnusedLocals": true,
"suppressImplicitAnyIndexErrors": true
"suppressImplicitAnyIndexErrors": true,
"plugins": [{ "transform": "ts-auto-mock/transformer", "cacheBetweenTests": false }]
},
"include": ["src"],
"exclude": ["node_modules"]

587
yarn.lock

File diff suppressed because it is too large Load Diff