Skip to content

Commit

Permalink
Merge pull request #118 from getAlby/chore/tests-mock-http
Browse files Browse the repository at this point in the history
chore: mock http calls in tests
  • Loading branch information
rolznz authored Dec 4, 2023
2 parents d172ac9 + a620996 commit e671557
Show file tree
Hide file tree
Showing 7 changed files with 380 additions and 129 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
3 changes: 3 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
setupFiles: [
"./setupJest.ts"
]
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"eslint-config-prettier": "^9.0.0",
"husky": "^8.0.3",
"jest": "^29.5.0",
"jest-fetch-mock": "^3.0.3",
"lint-staged": "^14.0.0",
"microbundle": "^0.15.1",
"nostr-tools": "^1.17.0",
Expand Down
3 changes: 3 additions & 0 deletions setupJest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import jestFetchMock from 'jest-fetch-mock';

jestFetchMock.enableMocks();
Loading

0 comments on commit e671557

Please sign in to comment.