-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add automerge-repo-react-hooks tests #112
Conversation
I was hoping to use a headless browser, so that we can test polyfills for the web navigation API, unfortunately this part of vitest is still experimental, and will not work until browser test isolation lands. vitest.config.ts:
|
}) | ||
|
||
test.skip("should return repo from context", () => { | ||
const wrapper = ({ children }) => ( | ||
<RepoContext value={repo} children={children} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work yet, once it does the PR will be ready for review
@@ -34,7 +34,7 @@ | |||
"dependencies": { | |||
"cbor-x": "^1.3.0", | |||
"debug": "^4.3.4", | |||
"eventemitter3": "^4.0.7", | |||
"eventemitter3": "^5.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add ES module support https://github.com/primus/eventemitter3/releases/tag/5.0.0
Turns out I needed |
Hey @neftaly, apologies for the delay in getting into this. I think for now we can disable this test in the test runner on the github action server but we'll need to figure out the best way to do that before I can land because it will either crash the tests or leave them hanging if we don't. |
Are you ok with renaming "yarn test" command to "yarn test-hooks"? Or do you want me to add configuration to actions? |
ah, that's extremely simple and totally fine by me for a stop-gap |
@neftaly I'm going to just do that for you since I don't see a patch yet and it's trivial, then merge. Thank you for this! |
Done! |
@@ -10,11 +10,22 @@ | |||
"main": "dist/index.js", | |||
"scripts": { | |||
"build": "tsc", | |||
"test-browser": "vitest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be "test": "vitest run",
Thanks! |
This PR adds tests for
useRepo
, using jsdom to mock a browser, via vitest.