iaincollins / structured-data-testing-tool

A library and command line tool to help inspect and test for Structured Data.
https://www.npmjs.com/package/structured-data-testing-tool
ISC License
64 stars 14 forks source link

Testing tool skips invalid JSON should report as a failure #24

Open dougnukem opened 4 years ago

dougnukem commented 4 years ago

Describe the bug sdtt does not report invalid JSON syntax errors as a failure and skips those JSON-LD blocks.

$ sdtt --url https://supplydrop.com
Error in jsonld parse - SyntaxError: Unexpected end of JSON input
Tests

  Schema.org > FAQPage - 100% (1 passed, 0 failed)
    ✓  schema in jsonld

Statistics

  Number of Metatags: 19
  Schemas in JSON-LD: 1
     Schemas in HTML: 0
      Schema in RDFa: 0
  Schema.org schemas: FAQPage
       Other schemas: 0
     Test groups run: 2
  Optional tests run: 44
 Pass/Fail tests run: 1

Results

    Passed: 1   (100%)
  Warnings: 0   (0%)
    Failed: 0   (0%)

  ✓ 1 tests passed with 0 warnings.

The google validator reports that as an error: https://search.google.com/structured-data/testing-tool/u/0/#url=https%3A%2F%2Fsupplydrop.com

Missing ',' or '}' in object declaration.

iaincollins commented 4 years ago

Thanks! I agree, that is something that should improved by communicating more clearly.

I'm going to re-classify as an enhancement in this case, so that other things that are more obviously defects (rather than sins of omission) can be prioritised.