Skip to content

TypeError: Cannot use 'in' operator to search for 'withCredentials' in undefined #218

@rahulkelaskar

Description

@rahulkelaskar

The library doesn't pass through Jest unit test. On debug it is observed that
NativeEventSource is undefined. Since the Jest runs on terminal NativeEventSource is undefined.
var R = NativeEventSource if (XMLHttpRequest != undefined && (NativeEventSource == undefined || !("withCredentials" in NativeEventSource.prototype))) {

I've tried multiple ways, but couldn't find any solution.

I'm currently using
angular: 12.2.0
"jest": "^27.0.3",
"jest-junit": "^11.1.0",
"jest-preset-angular": "9.0.0",
"jest-zone-patch": "~0.0.10",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions