Skip to content

Different util.inspect output making tests fail #596

@maxrimue

Description

@maxrimue

As #595 has shown, builds now fail with Node.js v6.4.0.

As it turns out, the tests fail because of this one test. It tests for yarg's output when a command is supplied that does not have a name. When yargs is about to output that error, it also uses util.inspect to show the content of the supplied command object (reference).

The test output shows that this very output is expected to be slightly different. The original object is:

{ desc: 'A command with no name',
  builder: [Function],
  handler: [Function] }

Interestingly, using util.inspect() on this object generates different outputs on different minors of Node.js v6:

v6.3.1:

'{ desc: \'A command with no name\',\n  builder: [ [Function: Function] ],\n  handler: [ [Function: Function] ] }'

v6.4.0:

'{ desc: \'A command with no name\',\r\n  builder: [ [Function: Function] ],\r\n  handler: [ [Function: Function] ] }'

I'm not sure if this is intended behaviour, so I'll report it on the Node.js repo.

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