FLUID-5475: Improve diagnostics when framework is used within node.js

Metadata

Source
FLUID-5475
Type
Improvement
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Antranig Basman
Reporter
Antranig Basman
Created
2014-07-17T14:14:43.094-0400
Updated
2015-08-20T15:41:37.452-0400
Versions
N/A
Fixed Versions
  1. 1.9
Component
  1. Framework
  2. Testing Infrastructure

Description

The diagnostics when the framework is used within node.js are frequently unhelpful, especially those from the IoC testing framework.

Many of these issues stem from the formatting strategy used by the default console.log implementation in node.js, which is based on their utility "util.inspect" -

http://nodejs.org/api/util.html#util_util_inspect_object_options
http://stackoverflow.com/questions/21524415/node-console-log-util-inspect-for-nested-object-array

Many test fixtures take the form of applying a jqUnit.assertDeepEq between compound objects - when these fail, the user is unhelpfully faced with a diagnostic of the form -
expected: [object Object] found: [object Object]

which is of no help in understanding the issue.

As well as this we should improve some cases when using the IoC testing framework where IoC resolution fails to locate a listener - this will produce diagnostics of the form "undefined has no member called apply" which similarly provides no help in understanding the cause of the failure.

We will make improvements to fluid.prettyPrintJSON, a long-standing utility in FluidDebugging.json, including robustifying it for dealing with the case of circularly linked structures, and provide a capped complex object trace controlled by a new framework option fluid.logObjectRenderChars , by default to supply complex object traces capped at 1024 characters.

Comments