-
Notifications
You must be signed in to change notification settings - Fork 8
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
test: injected providers #369
Conversation
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.
@0xisk thanks, there are some comments regarding tests.
@@ -3,7 +3,7 @@ import { Emitter, createNanoEvents } from "nanoevents"; | |||
import { Events, EventHandler, EventName } from "./types"; | |||
|
|||
export default class EventEmitter { | |||
private emitter: Emitter<Events>; | |||
emitter: Emitter<Events>; |
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.
I'd keep it private
|
||
beforeEach(() => { | ||
// Mocking private dependencies | ||
const mockTryInject = jest.spyOn(CryptKeeperInjectedProvider.prototype as any, "tryInject"); |
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.
Private dependencies is not the same as private methods.
Here you need to spy on window.postMessage
and check that it has been called with specific params
/** | ||
* @jest-environment jsdom | ||
*/ | ||
/* eslint @typescript-eslint/no-explicit-any: 0 */ // --> OFF |
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.
We don't use any for new code.
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.
@0xisk thanks, there are some comments regarding tests.
5b12089
to
c6b8a22
Compare
These changes are related to old project structure so they are not applicable for monorepo. |
Explanation
Unit-testing for:
More Information
Screenshots/Screencaps
N/A
Manual Testing Steps
N/A
Pre-Merge Checklist