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

Update the tests to use the Promise-based API #1349

Merged

Commits on Jun 27, 2023

  1. test: add test constructors for promise-based clients

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    3340ca4 View commit details
    Browse the repository at this point in the history
  2. test: add restTestOnJsonMsgpackAsync

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    1ca52a3 View commit details
    Browse the repository at this point in the history
  3. test: convert rest auth tests to Promise API

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    76a1e63 View commit details
    Browse the repository at this point in the history
  4. test: convert rest capability tests to Promise API

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    af38ec8 View commit details
    Browse the repository at this point in the history
  5. test: convert rest fallbacks tests to Promise API

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    a1fb8dd View commit details
    Browse the repository at this point in the history
  6. test: convert rest history tests to Promise API

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    6d0d329 View commit details
    Browse the repository at this point in the history
  7. test: remove legacy rest history promise test

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    b07d032 View commit details
    Browse the repository at this point in the history
  8. test: convert rest http tests to Promise API

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    24d299e View commit details
    Browse the repository at this point in the history
  9. test: convert rest constructor tests to Promise API

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    d40ea8f View commit details
    Browse the repository at this point in the history
  10. test: convert rest message tests to Promise API

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    152f4e5 View commit details
    Browse the repository at this point in the history
  11. test: remove legacy rest message promise test

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    8b9e0f9 View commit details
    Browse the repository at this point in the history
  12. test: convert rest presence tests to Promise API

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    d76a03f View commit details
    Browse the repository at this point in the history
  13. test: remove legacy rest presence promise test

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    4ef4a98 View commit details
    Browse the repository at this point in the history
  14. test: convert rest push tests to Promise API

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    844af87 View commit details
    Browse the repository at this point in the history
  15. test: remove legacy rest push promise tests

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    469229b View commit details
    Browse the repository at this point in the history
  16. test: convert rest request tests to Promise API

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    1e698e2 View commit details
    Browse the repository at this point in the history
  17. test: remove legacy rest request promise test

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    b694963 View commit details
    Browse the repository at this point in the history
  18. test: convert rest stats tests to Promise API

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    f882997 View commit details
    Browse the repository at this point in the history
  19. test: remove legacy rest stats promise test

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    2448be7 View commit details
    Browse the repository at this point in the history
  20. test: convert rest status test to Promise API

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    44808ed View commit details
    Browse the repository at this point in the history
  21. test: remove legacy rest status promise test

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    e9081a3 View commit details
    Browse the repository at this point in the history
  22. test: convert rest time test to Promise API

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    edcecfa View commit details
    Browse the repository at this point in the history
  23. test: remove legacy rest time promise test

    Co-authored-by: Lawrence Forooghian <lawrence@forooghian.com>
    owenpearson and lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    6796bed View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    17d2aaa View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    a36fe51 View commit details
    Browse the repository at this point in the history
  26. Remove parts of test relating to setOptions calling its callback imme…

    …diately
    
    As part of #1213, I’ll be updating this test to use the Promise-based
    API, to which the concept of "calls the callback before returning" can’t
    be detected, since the JavaScript engine always calls Promise callbacks
    asynchronously.
    lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    a1c3592 View commit details
    Browse the repository at this point in the history
  27. Prepare realtime channel publish disallowed test for conversion to Pr…

    …omise API
    
    When we switch to using the Promise-based API, we’ll need to wait for
    the result of `publish`, so let’s put the supporting code in place for
    that.
    lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    050b95b View commit details
    Browse the repository at this point in the history
  28. Update Realtime tests to use SDK’s Promise-based API

    I’ve chosen to do this with the lightest touch possible — that is,
    maintaining the tests’ callback-based approach and simply bridging the
    SDK’s Promise-based API back to callbacks. I did this for the sake of
    reviewability and not accidentally changing the behaviour of the tests
    in some subtle way that I’d then have to put time into understanding.
    
    It would be good to, at some point, update the structure of the tests to
    use `async` / `await`, to improve readability and to make them reflect
    how the users actually interact with the Promise-based API in the real
    world. I’ve split out into the separate task #1348.
    
    Note that I haven’t made any changes to the calls to EventEmitter’s
    `once` or `whenState` methods — we’re going to keep the callback-based
    versions of those methods, since there is no Promise equivalent of being
    able to turn them off using `off`.
    
    Resolves #1213.
    lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    43a2d1d View commit details
    Browse the repository at this point in the history
  29. Remove obsolete Promise-based Realtime tests

    No longer needed as of 43a2d1d. I’ve kept the tests for EventEmitter
    (since, as mentioned in aforementioned commit, the main body of the
    tests uses the callback-based API), and also for init.test.js, which
    tests the result of `require('../../promises')`.
    lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    45b9c3b View commit details
    Browse the repository at this point in the history
  30. Remove "Promise" from name of Ably*Promise helpers

    Thus replacing the (unused as of 6fe4914) callback versions.
    lawrence-forooghian committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    d0f034e View commit details
    Browse the repository at this point in the history