Skip to content

Commit

Permalink
Add test that will break with the next upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-picus-tink committed Aug 8, 2024
1 parent 3e5e54e commit 8d6945e
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 2 deletions.
9 changes: 9 additions & 0 deletions index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {It, mock, when} from 'strong-mock';

it('foo', () => {
const fn = mock<(data: {x: number}) => number>();

when(() => fn(It.isObject())).thenReturn(42);

expect(fn({x: 1})).toEqual(42)
})
7 changes: 7 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import('ts-jest').JestConfigWithTsJest} **/
module.exports = {
testEnvironment: "node",
transform: {
"^.+.tsx?$": ["ts-jest",{}],
},
};
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.0.0",
"description": "",
"scripts": {
"test": "exit 0"
"test": "jest"
},
"repository": {
"type": "git",
Expand All @@ -19,6 +19,8 @@
"@types/react-dom": "~17.0.11",
"@types/jest": "~29.5.0",
"jest": "~29.7.0",
"typescript": "~5.5.0"
"typescript": "~5.5.0",
"strong-mock": "~8.0.1",
"ts-jest": "~29.2.4"
}
}
139 changes: 139 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"strict": true,
"esModuleInterop": true
},
"include": ["**/*.ts"]
}

0 comments on commit 8d6945e

Please sign in to comment.