Skip to content

TypeError: val.entries is not a function #4922

@FezVrasta

Description

@FezVrasta

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

What is the current behavior?

 FAIL  src/FiltersPanel.spec.jsx
  ● renders the expected markup

    TypeError: val.entries is not a function

      at Object.<anonymous> (src/modules/common/filters-panel/components/FiltersPanel.spec.jsx:18:19)
          at new Promise (<anonymous>)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  console.error console.js:182
    Trace
        at printImmutableEntries (/Users/federicozivolo/project/web/node_modules/pretty-format/build/plugins/immutable.js:40:11)
        at Object.<anonymous>.exports.serialize (/Users/federicozivolo/project/web/node_modules/pretty-format/build/plugins/immutable.js:180:12)
        at printPlugin (/Users/federicozivolo/project/web/node_modules/pretty-format/build/index.js:245:10)
        at printer (/Users/federicozivolo/project/web/node_modules/pretty-format/build/index.js:290:12)
        at keys.map.key (/Users/federicozivolo/project/web/node_modules/pretty-format/build/plugins/lib/markup.js:30:19)
        at Array.map (<anonymous>)
        at Object.<anonymous>.exports.printProps (/Users/federicozivolo/project/web/node_modules/pretty-format/build/plugins/lib/markup.js:28:3)
        at Object.<anonymous>.exports.serialize (/Users/federicozivolo/project/web/node_modules/pretty-format/build/plugins/react_element.js:57:24)
        at printPlugin (/Users/federicozivolo/project/web/node_modules/pretty-format/build/index.js:245:10)
        at printer (/Users/federicozivolo/project/web/node_modules/pretty-format/build/index.js:290:12)

  ✕ renders the expected markup (3ms)

  console.log src/modules/common/filters-panel/components/FiltersPanel.jsx:11

(the additional stack trace is added by me with a console.trace() placed in the problematic file)

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.

Just run this repository tests to get the error:
https://github.com/FezVrasta/jest-pretty-print-bug

 FAIL  src/demo.test.jsx
  ✕ crashes badly and hopelessy... (11ms)

  ● crashes badly and hopelessy...

    TypeError: val.entries is not a function

      at Object.<anonymous>.it (src/demo.test.jsx:7:155)
          at new Promise (<anonymous>)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  console.log src/demo.test.jsx:6
    ShallowWrapper { length: 1 }

What is the expected behavior?

No errors pretty please 🙏

Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.

Look at the repository provided please.

Metadata

Metadata

Assignees

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