ajax icon indicating copy to clipboard operation
ajax copied to clipboard

Are there any tests for this?

Open wyuenho opened this issue 11 years ago • 9 comments

wyuenho avatar Feb 10 '14 09:02 wyuenho

No, this is un-tested. I've also just started working on then-request which is a successor to ForbesLindesay/ajax and has a much cleaner, simpler API, rather than being a drop in replacement for jQuery.

It's very early days for the development of then-request, but it does mean that I'm unlikely to do much in the way of maintaining ForbesLindesay/ajax.

ForbesLindesay avatar Feb 10 '14 15:02 ForbesLindesay

Is it possible that you keep this jQuerish API and just delegate everything to then-request? I've been looking for a minimalist drop in replacement for $.ajax without much luck.

wyuenho avatar Feb 10 '14 15:02 wyuenho

What we have here does fill that role. If you would like to submit unit tests for this module I will merge them. If you want to maintain it, I'll happily add you as a contributor?

It may be possible to make this delegate to then-request and just be an adapter to create a jQuery-like API. I would suggest waiting until then-request is a bit more stable first though.

ForbesLindesay avatar Feb 10 '14 16:02 ForbesLindesay

I hear you. Let me read some code first. I want to see how much this package covers $.ajax. Hopefully if my eyes haven't been gouged out yet after reading jQuery's code I can throw in some tests.

wyuenho avatar Feb 10 '14 17:02 wyuenho

This doesn't return jQuery's broken promise thingy, but other than that I think it should be fairly complete.

ForbesLindesay avatar Feb 11 '14 00:02 ForbesLindesay

Hi @ForbesLindesay, do you still want help pushing this forward?

lukelex avatar Jun 13 '14 16:06 lukelex

:+1: for this being a thing.

HenrikJoreteg avatar Jun 24 '14 03:06 HenrikJoreteg

then-request is now essentially complete. What I would now be keen for is to re-implement basically this functionality on top of that module, we can then build via browserify for client use and publish on npm for server side use (via the same API people are used to from jQuery). Unfortunately I just don't have the time to work on it at the moment, but I will review and accept pull requests that implement any of the following:

  • Add a dependency on then-request
  • Keep the jQuery style api but use then-request in place of all interactions with xhr
  • Add tests for everything but jsonp that run in node.js (this should be relatively simple, since then-request works in node).
  • Add travis-ci and all the badges to the readme (see then-request for an example)
  • Remove info about component from the readme (and delete component.json)
  • Fix build script in package.json to use --standalone and possibly produce an un-minified build as well.
  • Find a good way to add browser tests for the standalone build, including jsonp (perhaps using selenium)
  • Factor jsonp out into a separate module that implements it on both server and client, then perhaps make this depend on that.

ForbesLindesay avatar Sep 07 '14 13:09 ForbesLindesay

Also, if someone does a few of those, I'd be happy to add them as a contributor so they can review & merge other people's pull requests.

ForbesLindesay avatar Sep 07 '14 14:09 ForbesLindesay