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

Feature request: Expose sinon as global on website for quick testing #2414

Closed
mokkabonna opened this issue Nov 9, 2021 · 3 comments
Closed

Comments

@mokkabonna
Copy link
Contributor

mokkabonna commented Nov 9, 2021

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
Expose latest sinon as a global on the sinon website for quickly testing features of it in the developer console. This is a quick and simple way to test something without installing it via npm or CDN.

Ideally with a log statement printed that sinon is exposed when you open the console.

Describe alternatives you've considered
Either I have to download it and run it locally via some code that imports the module or run it on websites like runkit. Both of these alternatives are quite slower than just pressing F12 and playing with it in the console.

Additional context
Many websites for js libs expose their own library as a global on the website, like lodash (as _ ), vue, react.

This is proably in the category of nice to have, but well, it would be nice to have :)


Thanks for a great library, been using it for years! It was of great assistance to get started with serious js testing years ago.

@mokkabonna mokkabonna changed the title Expose sinon as global on website for quick testing Feature request: Expose sinon as global on website for quick testing Nov 9, 2021
@fatso83
Copy link
Contributor

fatso83 commented Nov 9, 2021

We talked about this years ago, and it is a relatively quick win, so if anyone put in the minutes to add it, then that would surely be accepted. I am sure it would be enough to add a a small <script module ..../> reference to the default Jekyll template, where the script either referenced one of the locally scripts or a SkyPack version.

P.S. You might have seen already, but we have runnable examples on the documentation. Like here: https://sinonjs.org/releases/v12.0.1/spies/. This is editable in the browser and runs via RunKit. It is lacking on some pages, but that is only because no one has put in the effort to complete this for every doc page.

@fatso83 fatso83 reopened this Jan 19, 2022
@fatso83
Copy link
Contributor

fatso83 commented Jan 19, 2022

Did not appear for some reason. Will verify before closing.

fatso83 added a commit that referenced this issue Jan 28, 2022
fatso83 added a commit that referenced this issue Jan 28, 2022
@fatso83
Copy link
Contributor

fatso83 commented Jan 28, 2022

Verified to be working

@fatso83 fatso83 closed this as completed Jan 28, 2022
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