We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I created a repository showcasing this:
https://github.com/jpasquers/jest-mock-extended-fail-example
The important part being the following
import { mockDeep } from "jest-mock-extended"; interface X { y: { [a: string]: string } z: { z1: string; } } describe('nested mock', () => { it('should be empty inner object', () => { let mock = mockDeep<X>({y: {}}); //This fails -> Received: [Function mockConstructor] expect(mock.y["something"]).toBeUndefined(); }) })
Since I am providing an implementation of y that is {} shouldn't mock.y["something"] be undefined?
{}
mock.y["something"]
The text was updated successfully, but these errors were encountered:
Just ran into this surprise as well.
Edit - using undefined instead of an empty object literal {} ended up working for me:
undefined
mockDeep<X>({y: undefined});
Sorry, something went wrong.
No branches or pull requests
I created a repository showcasing this:
https://github.com/jpasquers/jest-mock-extended-fail-example
The important part being the following
Since I am providing an implementation of y that is
{}
shouldn'tmock.y["something"]
be undefined?The text was updated successfully, but these errors were encountered: