Skip to content

Commit

Permalink
chore: add ts auto mock
Browse files Browse the repository at this point in the history
  • Loading branch information
jonyw4 committed Nov 22, 2021
1 parent a2e34fd commit a6cd66b
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 10 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"devDependencies": {
"@babel/core": "7.16.0",
"@playwright/test": "1.14.1",
"@storybook/addon-actions": "6.3.12",
"@storybook/addon-essentials": "6.3.12",
"@storybook/addon-links": "6.3.12",
Expand All @@ -25,12 +26,14 @@
"babel-loader": "8.2.3",
"eslint": "<8.0.0",
"jest": "27.3.1",
"jest-ts-auto-mock": "^2.0.0",
"lerna": "4.0.0",
"markdown-spellcheck": "1.3.1",
"markdownlint-cli": "0.29.0",
"ts-auto-mock": "^3.5.0",
"ts-jest": "27.0.7",
"typescript": "4.4.4",
"@playwright/test": "1.14.1"
"ttypescript": "^1.5.12",
"typescript": "4.4.4"
},
"dependencies": {}
}
11 changes: 9 additions & 2 deletions webapp/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
transform: {
".(ts|tsx)": "ts-jest"
},
globals: {
"ts-jest": {
compiler: "ttypescript",
},
},
setupFiles: ["<rootDir>tests/config.ts"],
};
1 change: 1 addition & 0 deletions webapp/tests/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "jest-ts-auto-mock";
6 changes: 6 additions & 0 deletions webapp/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"compilerOptions": {
"target": "es5",
"plugins": [
{
"transform": "ts-auto-mock/transformer",
"cacheBetweenTests": false
}
],
"lib": [
"dom",
"dom.iterable",
Expand Down
Loading

0 comments on commit a6cd66b

Please sign in to comment.