Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

lastCookieString.split error with httpBackend.flush() #11373

Closed
@jcdalton2201

Description

@jcdalton2201

Using v1.4.0-build.3918+sha.4588e62 my unit test are now having the following error.

    TypeError: 'undefined' is not an object (evaluating 'lastCookieString.split'
)
        at C:/TR Forks/fef/bower_components/angular/angular.js:17354
        at sendReq (C:/TR Forks/fef/bower_components/angular/angular.js:9824)
        at C:/TR Forks/fef/bower_components/angular/angular.js:9542
        at processQueue (C:/TR Forks/fef/bower_components/angular/angular.js:140
60)
        at C:/TR Forks/fef/bower_components/angular/angular.js:14076
        at C:/TR Forks/fef/bower_components/angular/angular.js:15283
        at C:/TR Forks/fef/bower_components/angular/angular.js:15098
        at C:/TR Forks/fef/bower_components/angular-mocks/angular-mocks.js:1508
        at C:/TR Forks/fef/test/spec/services/FefLoagger.js:263

The unit test is this

it('test mult call is correct format.', function() {
        var success = true;
        httpBackend.expectPOST('/demo/logs')
            .respond(
                function(method, url, data, headers) {
                    var validData = {
                        message: ['test'],
                        level: 'log',
                        name: 'fef:log1'
                    };
                    data = JSON.parse(data);
                    if (data.message[0] === validData.message[0] &&
                        data.level === validData.level &&
                        data.name === validData.name) {
                        return [200, {
                            token: '12345'
                        }];
                    } else {
                        success = false;
                        return [400, {
                            failure: 'bad'
                        }];
                    }
                });
        var log1 = FefLogger.getLogger('log1');
        log1.log('test');
        httpBackend.flush();
        expect(success).toBe(true);

    });

the line 263 coralates with the httpBackend.flush();
this unit test did work with 1.4.0-beta.0 and 1.3.15

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions