v4.0 - Adds support for flagging tests as optional
Summary
This release adds support for optional properties in presets (properties which are valid, but not required) and enhancements to the output of the CLI.
It also includes a breaking change, but it is unlikely to impact many (if any users) as the feature was rarely used and is likely to be easy to resolve by migrating tests to the new option if you are impacted by it.
Changes
Changes to supported options
This release adds a new boolean flag to tests called optional
and removes support for the more confusingly named info
option (which used to perform a similar role but had limited utility).
Tests marked as optional
do not count towards passed, failed or total tests run, though the number of optional tests run is displayed as separate statistic in the Command Line Interface.
The result of optional tests run can be inspected via the CLI and API and still have a status of passed or failed which is visible if a test is inspected, however optional tests are displayed differently on the command line (and only visible if the property being tested is found) and optional tests are grouped separately in the API response (they can be inspected by iterating over results.optional
).
Changes to the CLI
Additionally, this update also includes minor changes to the CLI output to better highlight warnings and optional information and to make it easier to view and debug results.
Additional information in the CLI output is now shown by default, including listing all properties found on any Schema objects on the page (though the tool does not currently validate the actual properties).
Example CLI output
An example of the new output below shows all the properties found on Schema.org objects for a page, and then lists the properties found on them that are known to be supported by Google for those schemas.
NB: The test below was run with the option --presets Google
.
Migrating
- If you have used the option
info
in any existing tests or custom presets, you can probably just change them all to theoptional
, however despite being a documented it option it seems like no-one was actually using it and it was not used by any of the presets, and the property was only used by internal logic. - If you were using the
results.info
property from the API response, you should change this toresults.optional
. Unlike tests with theinfo
option, all tests withoptional
set totrue
will be here, regardless of if they pass or fail (they will never end up in.passed
,.failed
or.warnings
). - In most cases the change to the supported options will not impact the number of tests reported as run.
- Two new tests for schemas supported by Google (WebPage and Organization) are included in this release, which may increase the number of test performed if you are using the Google preset.
Notes
This issue resolves issues reported in #11 by displaying additional properties found on Schemas by default.