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

export spy function as names export from chai-spies #106

Open
Fuzzyma opened this issue Nov 10, 2018 · 1 comment
Open

export spy function as names export from chai-spies #106

Fuzzyma opened this issue Nov 10, 2018 · 1 comment

Comments

@Fuzzyma
Copy link

Fuzzyma commented Nov 10, 2018

Atm one as to register the spies before beeing able to use it with the chai-object chai.spy

However, I like to import only what I need:

import {expect, use} from 'chai'
import spies from 'chai-spies'

use(spies)

As you can see I cannot grab the spy function because its not available at import time.
Thats why it would be cool to have a named export on chai-spies which returns a wrapper to the chai.spy. That way you can do:

import {expect, use} from 'chai'
import spies, {spy} from 'chai-spies'

use(spies)

What do you think?

@nopeless
Copy link

nopeless commented Oct 7, 2022

This issue is stale, but if you are using TypeScript you can define global variables

declare var Spy: import("chai").spy;

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

No branches or pull requests

2 participants