title: Jasmine Error on same string, 'Expected .. to equal ...'
body: <p>I'm getting this error, but I've checked and tested the strings and they are exactly the same:</p>
  
  <pre><code>Expected { $$state : { status : 1, value : { customerNumber : 'customerNumber', name : 'name', userId : 'buId', customerType : 'type', address : 'displayAddress' } } } 
  to equal { $$state : { status : 1, value : { customerNumber : 'customerNumber', name : 'name', userId : 'buId', customerType : 'type', address : 'displayAddress' } } }.
  Error: Expected { $$state : { status : 1, value : { customerNumber : 'customerNumber', name : 'name', userId : 'buId', customerType : 'type', address : 'displayAddress' } } } to equal { $$state : { status : 1, value : { customerNumber : 'customerNumber', name : 'name', userId : 'buId', customerType : 'type', address : 'displayAddress' } } }.
          at C:/customerServiceSpec.js:70
  </code></pre>
  
  <p>The only thing I can notice is there is a full stop at the end, but I think Jasmine is adding that in the response. Here is my test code:</p>
  
  <pre><code>describe('CustomerService', () =&gt; {
      var mockUserSession: any = {};
      var testService any = {};
      var $q: ng.IQService;
      var createCustomerDetailsService;
      var customerDetailsService;
      var createResolvedPromise;
      var createRejectedPromise;
      var resolvePromises;
  
      var testResponse = {
          customers: {
              displayCustomerNumber: 'customerNumber',
              name: 'name',
              id: 'id',
              type: 'type',
              displayAddress: 'displayAddress'
          }
      };
  
      var serviceResponse={
          $$state: {
              status: 1,
              value: {
                  customerNumber: 'customerNumber',
                  name: 'name',
                  id: 'id',
                  customerType: 'type',
                  address:'displayAddress'
              }
          }
      };
  
      var rootScope;
  
      beforeEach(() =&gt; {
          module('app.customer');
  
          inject(( _$q_, $injector) =&gt; {
              this.$q = _$q_;
              rootScope = $injector.get('$rootScope');
  
              createResolvedPromise = (result) =&gt; {
                  return () =&gt; {
                      return this.$q.when(result);
                  };
              };
  
              resolvePromises = () =&gt; {
                  rootScope.$digest();
              };
  
              createCustomerDetailsService = () =&gt; {
                  return new app.customer.CustomerService(
                      testService);
              };
          });
  
      });
  
      it('WILL search by customer ID and return a customers details', () =&gt; {
          var searchResponsePromise;
  
          testService.getCustomerDetails = jasmine.createSpy("getCustomerDetails").and.callFake(createResolvedPromise(testResponse));
          customerDetailsService = createCustomerDetailsService();
          searchResponsePromise = customerDetailsService.getCustomerDetails('12345678');
          resolvePromises();
  
          expect(searchResponsePromise).toEqual(serviceResponse);
      });
  });
  </code></pre>
  
  <p>And here is my service:</p>
  
  <pre><code>public getCustomerDetails(customerID:string): ng.IPromise&lt;ICustomerDetails&gt; {
      return this.testService.getCustomerDetails(customerID).then((customerResponse:ICustomerResult) =&gt; {
  
          var customer = customerResponse.customers;
  
          var customerDetailsResult:ICustomerDetails = {
              customerNumber: customer.displayCustomerNumber,
              name: customer.name,
              userId: customer.buId,
              customerType: customer.type,
              address: customer.displayAddress
          };
  
          return customerDetailsResult;
      });
  }
  </code></pre>
  
  <p>Thanks for any help.</p>