giphy-api icon indicating copy to clipboard operation
giphy-api copied to clipboard

Browser tests

Open austinkelleher opened this issue 8 years ago • 3 comments

With the newly implemented browser bundling, we should introduce a web testing framework (perhaps phantomjs).

austinkelleher avatar Jul 23 '16 01:07 austinkelleher

@mattbierner I haven't published my changes yet, but I added browser support to this module. Do you mind testing it with your use case?

austinkelleher avatar Jul 23 '16 01:07 austinkelleher

My use case of the Giphy api is pretty simple: just the search api with the public key (example project). The project is also using webpack for building, so it may not be the use case you are targeting.

I did install the latest bits though and confirmed they still work fine with webpack. You can also include dist/bundle.js using webpack, but webpack complains about using a generated source file.

To tests things more directly, I also tried using the bundle.js file with a <script src="giphy-api/dist/bundle.js"></script> , but had to rebuild the bundle with a global export: ./node_modules/browserify/bin/cmd.js index.js -s giphy > dist/bundle.js to allow using window.giphy from my project. After that, everything worked fine.

Again, not sure how useful that is beyond confirming that the basic functionality still works. Please let me know if any other info would be helpful.

mattbierner avatar Jul 23 '16 18:07 mattbierner

Thanks for taking a look. I added --standalone GiphyAPI to the build script and published 1.2.0.

austinkelleher avatar Jul 29 '16 11:07 austinkelleher