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

Browser support #68

Closed
JamesMessinger opened this issue Jan 31, 2016 · 7 comments
Closed

Browser support #68

JamesMessinger opened this issue Jan 31, 2016 · 7 comments

Comments

@JamesMessinger
Copy link
Member

Chai and Superagent can both be run in Node or in web browsers. It would be great if your plugin worked in browsers too. This would allow people to write universal tests that can run in Node (great for CI) and in browsers (great for real-world testing). Mocha also supports both Node and web browsers, so it's dead-simple to accomplish truly universal tests.

I don't think it would even require many changes to the code, since most of your dependencies are already universal. And some dependencies (like cookie jar) wouldn't be needed when running in a browser. You could probably just bundle your existing code via Browserify or WebPack.

@keithamus
Copy link
Member

Thanks for the issue @BigstickCarpet.

You're quite right - it could be useful to have this work in the browser. Do you fancy trying to tackle this? If you need any help let me know.

@JamesMessinger
Copy link
Member Author

Sure, I can take a crack at it. Does my approach sound good to you? I'll just add Browserify to package it up into a browser-safe bundle.

@keithamus
Copy link
Member

Sounds perfect 😄.

@JamesMessinger
Copy link
Member Author

Step 1: getting all the existing tests passing. I've submitted a PR for that: #69

@JamesMessinger
Copy link
Member Author

Step 2: browser support. Done. :)

@keithamus
Copy link
Member

@BigstickCarpet this one can be closed right? I'm going to close it for now, LMK if it needs re-opening 😄

@JamesMessinger
Copy link
Member Author

Yep. sorry, I should have closed it months ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants