Skip to content

Support .toString() for cloudstate transaction objects #17

@kevgug

Description

@kevgug

No support for console.log() directly on getRoot("xxxxxxx") makes debugging test cases more difficult.

How to reproduce

Any test file

{
  const object = {
    value: "hello" // can be any value
  };

  setRoot("test-root", object);
  commit();
}

{
  const root = getRoot("test-root");
  console.log("root", root);
}

Terminal output

root [Internal Formatting Error] TypeError: Cannot convert a Symbol value to a string
    at parseInt (<anonymous>)
    at Object.get (ext:cloudstate/cloudstate.js:499:23)
    at formatRaw (ext:deno_console/01_console.js:621:18)
    at formatValue (ext:deno_console/01_console.js:529:10)
    at formatProperty (ext:deno_console/01_console.js:1618:11)
    at formatRaw (ext:deno_console/01_console.js:931:9)
    at formatValue (ext:deno_console/01_console.js:529:10)
    at inspectArgs (ext:deno_console/01_console.js:3043:17)
    at console.log (ext:deno_console/01_console.js:3112:7)
    at file:///xxxxxxxx/cloudstate/runtime/tests/xxxxxxxx:15:11

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