Skip to content

foreign test fails with a JSON parsing error. #782

@Thayorns

Description

@Thayorns

@yegor256

The foreign test fails with a JSON parsing error:

1) foreign
     inspects foreign objects and prints a report:
   Error: Command failed: node D:\a\eoc\eoc\src\eoc.js --batch foreign --verbose --parser=0.59.0 --home-tag=0.58.6 -t D:\a\eoc\eoc\temp\test-foreign\simple\target
Unexpected non-whitespace character after JSON at position 11819 (line 251 column 2)

The specific reason is in the file src/commands/foreign.js on line 16:

module.exports = function(opts) {
  const file = path.resolve(opts.target, 'eo-foreign.json'),

// THIS LINE
    all = JSON.parse(fs.readFileSync(file, 'utf8'));

  console.info('There are %d objects in %s:', all.length, rel(file));
  all.forEach((obj) => {
    console.info('  %s', obj.id);
  });
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions