diff --git a/test/integration/blocks-schema.test.js b/test/integration/blocks-schema.test.js index 8e4ee17b48ff5..1bc75555d6b88 100644 --- a/test/integration/blocks-schema.test.js +++ b/test/integration/blocks-schema.test.js @@ -21,6 +21,16 @@ describe( 'block.json schema', () => { ] ); const ajv = new Ajv(); + test( 'strictly adheres to the draft-04 meta schema', () => { + // Use ajv.compile instead of ajv.validateSchema to validate the schema + // because validateSchema only checks syntax, whereas, compile checks + // if the schema is semantically correct with strict mode. + // See https://github.com/ajv-validator/ajv/issues/1434#issuecomment-822982571 + const result = ajv.compile( blockSchema ); + + expect( result.errors ).toBe( null ); + } ); + test( 'found block folders', () => { expect( blockFolders.length ).toBeGreaterThan( 0 ); } );