Skip to content

Missing globalThis typecheck for automated testing #602

@torbenvanassche

Description

@torbenvanassche

Describe the bug

const isMac = /Mac/.test( globalThis?.navigator?.platform ); in CameraControls.ts is not sufficient to test for globalThis being potentially undefined.
We are running automated tests using Puppeteer and these automated tests are failing on this check since a globalThis does not exist in this context.

To Reproduce

Running with this package in a headless browser should cause the issue to appear.

Code

const isMac = /Mac/.test(typeof globalThis !== undefined && globalThis?.navigator?.platform);

Live example

No response

Expected behavior

No client-side polyfill requirement to get around the issue.

Screenshots or Video

No response

Device

Desktop

OS

Windows, MacOS, Linux

Browser

Chrome, Firefox

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