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

Consolidate presets - allow presets to contain other presets #6

Closed iaincollins closed 5 years ago

iaincollins commented 5 years ago

How could the tool be better? Please describe. Presets should be able to contain other suites (with no limit on the number of levels down), so you can have a suite like "Google" which contains the existing presets and specifically raise warnings and errors that reflect how Google validates structured data.

The purpose of this is to separate testing general schema validity (e.g valid props and valid values) from checking for specific properties / values expected by specific implementations, such as by Google, Bing, etc

This will make it possible to evaluate pages for technical correctness, independently of checking for compatibility with specific implementations - only some (or none) of which may be relevant.

Describe the solution you'd like The implementation may need to have something like adding support for a test to only run a test suite if a corresponding schema was actually found. For example, this could be done by adding a conditional property at a top level to presets, which contains a test (and optionally an expect) property.

As part of this work, existing "presets" (except Twitter and Facebook) should be consolidated under a test suite called "Google", with some sort of check evaluated to determine if a suite (e.g. "Article", "NewsArticle", etc) should run.

iaincollins commented 5 years ago

Resolved by PR #8