Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-21670

The JS REST client: tests fixes and refactorings

    XMLWordPrintable

Details

    Description

      • hasOwnProperty loops are never tested with objects, which don't have this property.
      • No test for calling ConnectionManager#request wihout a callback. Essentially there exists code to do this, eventhough according to the design document the callback isn't optional. The same is true for delete and notAuthorizedRequest.
      • No test on Connections used without specifying custom headers in the Request
      • Usage of sinon.js in combination with Chai.js and sinon-chai could allow for more readable expectations. An alternative would be to create a bunch of own jasmine Matchers to test things like calls to the mocked connection manager.
      • Math.random should not be used in tests. (Except in very rare situations)
      • The semantics used in conjunction with describe and it are not 100% correct. Both calls should be readable like an english sentence:
            describe('PromiseCAPI', function() {
                 it('should be instantiable with a CAPI service', function() {...});
                      describe('FunctionWrapping', function() {
                            it('should wrap services into PromiseService', function() {...});
                 });
            });
        

      Attachments

        Activity

          People

            Unassigned Unassigned
            Anton.Petrushenkov-obsolete@ez.no Anton Petrushenkov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 7 hours
                1w 7h