Skip to content

TypeError while initializing in Node 19 #438

@jonathanschoeller

Description

@jonathanschoeller
  • FakeTimers version : 9.1.2
  • Environment : node:19.0-alpine@sha256:48e43334c84762aa05c18dac37ec5ca396e9d55c5cb053f15cd4edbfe89a0914 (not reproducible in node:18.11-alpine)
  • Example URL : N/A
  • Other libraries you are using: @jest/fake-timers

What did you expect to happen?
The code below to execute without throwing an exception.

What actually happens
An exception is thrown:

TypeError: Cannot assign to read only property 'performance' of object '[object global]

at hijackMethod (node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:946:32)
at Object.install (node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1733:17)

How to reproduce
Run the following:

var FakeTimers = require("@sinonjs/fake-timers");

var clock = FakeTimers.install();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions