Skip to content

Commit

Permalink
Fix saved-views-client tests (#56)
Browse files Browse the repository at this point in the history
@itwin/saved-views-client tests were failing in release pipeline because
I didn't update tests to account for the changes in client
implementation.

Upon a closer inspection of the saved-views-client test file, I found
that
* tests weren't executing expectation verification code paths, which
made them basically inert
* `fetch` global function was not being restored after the tests were
done running
* one test was duplicated

I rewrote `ITwinSavedViewsClient.test.ts` while utilising as much of the
existing code as possible to fix these issues. I also made
saved-view-client tests run in CI pipelines and updated vitest
dependency for good measure.
  • Loading branch information
roluk authored Apr 8, 2024
1 parent b9d728b commit 7d727e8
Show file tree
Hide file tree
Showing 5 changed files with 380 additions and 509 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@ jobs:
- name: Typecheck
run: npm run typecheck

- name: Check saved-views-client unit test coverage
run: npm run test:cover --prefix ./packages/saved-views-client

- name: Check saved-views-react unit test coverage
run: npm run test:cover --prefix ./packages/saved-views-react
2 changes: 1 addition & 1 deletion packages/saved-views-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
"happy-dom": "^10.5.2",
"typescript": "^5.3.3",
"vite": "^5.0.13",
"vitest": "^1.0.4"
"vitest": "^1.4.0"
}
}
Loading

0 comments on commit 7d727e8

Please sign in to comment.