Skip to content

Sandbox throws error 'cannot stub non-existent own property' #1537

@ZebraFlesh

Description

@ZebraFlesh

I just tried upgrading from 2.4.1 to 3.2.1 and encountered the following issue. This code works in 2.4.1:

        const spy = sandbox.spy();
        sandbox.stub(window, 'google').value({
            maps: {
                LatLng: x => x,
                Map: spy
            }
        });

But in 3.2.1 it throws an exception: TypeError: Cannot stub non-existent own property google

It's not mentioned in the migration guide so it appears to be a regression.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions