Skip to content

jest error message resulting in circular JSON #44

@hkong-mitre

Description

@hkong-mitre

This should be noted in the documentation: under some circumstances: when a subset of files have changed, and the opensearch docker containers are not running, jest tries to show an error message (presumably due to not being able to reach the opensearch server) that results in this circular JSON error:

node:internal/child_process/serialization:159
    const string = JSONStringify(message) + '\n';
                   ^

TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Object'
    |     property '_httpMessage' -> object with constructor 'Object'
    --- property 'socket' closes the circle
    at stringify (<anonymous>)
    at writeChannelMessage (node:internal/child_process/serialization:159:20)
    at process.target._send (node:internal/child_process:852:17)
    at process.target.send (node:internal/child_process:752:19)
    at reportSuccess (/Users/hkong/devel/cve5/task-cc+cmc/cve-core/node_modules/jest-worker/build/workers/processChild.js:59:11)

The simplest solution is to start up the opensearch docker container.

This happened when the following files changed and running npm test. It does not happen, however, when each file is tested independently:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions