Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

jasmine-globals: async SpyStrategy methods are not supported #577

Closed
puglyfe opened this issue May 14, 2024 · 0 comments 路 Fixed by #578
Closed

jasmine-globals: async SpyStrategy methods are not supported #577

puglyfe opened this issue May 14, 2024 · 0 comments 路 Fixed by #578

Comments

@puglyfe
Copy link
Contributor

puglyfe commented May 14, 2024

馃憢 another one from me. async jasmine SpyStrategy methods (i.e. rejectWith and resolveTo) trigger Unsupported Jasmine functionality warnings (source). These have jest equivalents of mockResolvedValue(value) and mockRejectedValue(value).

Example input:

jasmine.createSpy().and.resolveTo('some value');

Actual output:

// Logs `Unsupported Jasmine functionality "jasmine.createSpy().and.resolveTo".` during transform
jest.fn().and.resolveTo('some value'); // not valid

Expected output:

jest.fn().mockResolvedValue('some value');

I will have a PR with a fix shortly.

@puglyfe puglyfe changed the title jasmine-globals: support for async SpyStrategy methods jasmine-globals: async SpyStrategy methods are not supported May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant