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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types(SpyOn): Add callable typing #1432

Merged

Conversation

pikax
Copy link
Contributor

@pikax pikax commented Jun 5, 2022

Just allowing the correct typing to spyOn

const a = {
  call(a: 1) {
    return a
  }
}

a.call(1)

const ss = spyOn(a, 'call')
ss(1)
// @ts-expect-error invalid type
ss('2')

@netlify
Copy link

netlify bot commented Jun 5, 2022

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2176521
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/629c59e849f2d00008af4d99
😎 Deploy Preview https://deploy-preview-1432--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@pikax pikax changed the title types(SpyOn): Add callable type types(SpyOn): Add callable typing Jun 5, 2022
@sheremet-va sheremet-va enabled auto-merge (squash) June 5, 2022 07:30
@sheremet-va sheremet-va merged commit 17dfd39 into vitest-dev:main Jun 5, 2022
@pikax pikax deleted the types_add_callable_to_SpyInstance_type branch June 5, 2022 07:32
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 this pull request may close these issues.

None yet

2 participants