Skip to content

Commit

Permalink
Mock @orangekit/sdk to run jest test
Browse files Browse the repository at this point in the history
Reverts 553b5be commit. We can just
mock the `@orangekit/sdk` module globally to run jest tests correctly
w/o converting the JS files to CommonJS syntax.
  • Loading branch information
r-czajkowski committed May 15, 2024
1 parent 196b94f commit 6499c9a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions sdk/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { JestConfigWithTsJest } from "ts-jest"

const jestConfig: JestConfigWithTsJest = {
preset: "ts-jest/presets/js-with-ts",
preset: "ts-jest",
testPathIgnorePatterns: ["<rootDir>/dist/", "<rootDir>/node_modules/"],
transformIgnorePatterns: ["/node_modules/(?!@orangekit/sdk)/"],
}

export default jestConfig
1 change: 1 addition & 0 deletions sdk/test/__mocks__/@orangekit/sdk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jest.mock("@orangekit/sdk")
2 changes: 0 additions & 2 deletions sdk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"esModuleInterop": true,
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"skipLibCheck": true,
"allowJs": true
},
"include": ["src", "test", "src/typings.d.ts", "jest.config.js"]
}

0 comments on commit 6499c9a

Please sign in to comment.