Skip to content

Different behavior with window global scope in newer Node.js versions #3675

@ndresx

Description

@ndresx

Do you want to request a feature or report a bug?
bug?

What is the current behavior?
When deleting something from the global window scope during 2 test runs, the behavior is different when using for example Node.js 7.4.0 (2nd test passes) and 7.9.0/7.10.0 (2nd test fails).

If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can yarn install and yarn test.
https://repl.it/IVBE/7

What is the expected behavior?
I don't know what the expected behavior should be, but I guess the one on newer Node.js versions where the second test is failing because the key was deleted seems to be the right one. That might not be even a Jest related issue, or an issue at all?

 FAIL  src\add-test.js
  ● require › case 2

    TypeError: Cannot read property 'value' of undefined

      at Object.<anonymous> (src/add-test.js:12:28)
      at Promise.resolve.then.el (node_modules/p-map/index.js:42:16)
      at process._tickCallback (internal/process/next_tick.js:109:7)

Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Jest: 19.0.2 and 20.0.4
Node.js: 7.4.0 (working) and 7.9.0/7.10.0 (not working)

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