Skip to content

Commit

Permalink
test(backstage-plugin): Add msw and refactor tests
Browse files Browse the repository at this point in the history
Add msw to mock backend and avoid mocking the service.
Simplify some test cases by checking for only the needed elements.
Add error handling to the data service.

Addresses #71
  • Loading branch information
kylejwatson committed Nov 16, 2023
1 parent d43ba3b commit fc958d7
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 292 deletions.
13 changes: 11 additions & 2 deletions backstage-plugin/plugins/open-dora/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
"msw": "^2.0.6",
"undici": "^5.27.2"
},
"files": [
"dist",
Expand All @@ -64,6 +65,14 @@
"lines": 100,
"statements": 100
}
}
},
"testEnvironmentOptions": {
"customExportConditions": [
""
]
},
"setupFiles": [
"./jest.polyfills.js"
]
}
}
Loading

0 comments on commit fc958d7

Please sign in to comment.