...
 
Commits (19)
......@@ -129,7 +129,7 @@ Release:
GIT_COMMITTER_NAME: "David Sveningsson"
GIT_COMMITTER_EMAIL: "ext@sidvind.com"
script:
- npm run semantic-release -- --debug
- npm run semantic-release
.downstream: &downstream
stage: postrelease
......
# html-validate changelog
## [2.18.1](https://gitlab.com/html-validate/html-validate/compare/v2.18.0...v2.18.1) (2020-03-22)
### Bug Fixes
- **meta:** allow regexp literal in element schema ([444a472](https://gitlab.com/html-validate/html-validate/commit/444a4726f7b8693188ad80c725f57f0e33844ca7)), closes [#70](https://gitlab.com/html-validate/html-validate/issues/70)
- **meta:** make all meta properties optional in type declaration ([eac5052](https://gitlab.com/html-validate/html-validate/commit/eac505234e2bdac2fb6d19ba8ef81bd947a7bba9))
- **meta:** support case-insensitive regexp flag ([96e7343](https://gitlab.com/html-validate/html-validate/commit/96e734396f9ee90358a4b74e091f14387eda9c99)), closes [#69](https://gitlab.com/html-validate/html-validate/issues/69)
- **rules:** use original wcag rule names ([1d5aa3c](https://gitlab.com/html-validate/html-validate/commit/1d5aa3c83add6b51bf062508cbaf9a868572446f))
### Reverts
- Revert "ci: temporary add debug to troubleshoot @semantic-release/gitlab" ([b4d016b](https://gitlab.com/html-validate/html-validate/commit/b4d016b442e618b38b5140de17d59b6393956ded))
# [2.18.0](https://gitlab.com/html-validate/html-validate/compare/v2.17.1...v2.18.0) (2020-03-11)
### Bug Fixes
......
......@@ -12,7 +12,7 @@ Array [
"line": 1,
"message": "<img> is missing required \\"alt\\" attribute",
"offset": 1,
"ruleId": "WCAG/H37",
"ruleId": "wcag/h37",
"selector": "img",
"severity": 2,
"size": 3,
......
......@@ -26,16 +26,19 @@ markup["frontpage-components"] = `<my-inline>
describe("docs/index.md", () => {
it("inline validation: frontpage-contentmodel", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["frontpage-contentmodel"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: frontpage-a17y", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"wcag/h37":"error","element-required-attributes":"error","input-missing-label":"error"}});
const report = htmlvalidate.validateString(markup["frontpage-a17y"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: frontpage-components", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-inline":{"phrasing":true,"permittedContent":["@phrasing"]},"my-block":{"flow":true},"my-deprecated":{"phrasing":true,"deprecated":"replaced with <my-other>"}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["frontpage-components"]);
expect(report.results).toMatchSnapshot();
......
......@@ -8,6 +8,7 @@ markup["{{ validation.name }}"] = `{{ validation.markup }}`;
describe("{{ doc.fileInfo.fullpath }}", () => {
{%- for validation in doc.validations %}
it("inline validation: {{ validation.name }}", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({{ validation.config | dump }});
const report = htmlvalidate.validateString(markup["{{ validation.name }}"]);
expect(report.results).toMatchSnapshot();
......
......@@ -10,6 +10,7 @@ markup["inheritance"] = `<my-component>
describe("docs/guide/metadata/inheritance.md", () => {
it("inline validation: inheritance", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-component":{"inherit":"label"}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["inheritance"]);
expect(report.results).toMatchSnapshot();
......
......@@ -14,26 +14,31 @@ markup["deprecated"] = `<my-component duck="dewey">...</my-component>
describe("docs/guide/metadata/restrict-attributes.md", () => {
it("inline validation: enum", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-component":{"flow":true,"attributes":{"duck":["huey","dewey","louie"]}}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["enum"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: regexp", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-component":{"flow":true,"attributes":{"ducks":["/\\d+/"]}}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["regexp"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: boolean", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-component":{"flow":true,"attributes":{"quacks":[]}}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["boolean"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: required", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-component":{"flow":true,"requiredAttributes":["duck"]}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["required"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: deprecated", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-component":{"flow":true,"deprecatedAttributes":["duck"]}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["deprecated"]);
expect(report.results).toMatchSnapshot();
......
......@@ -25,16 +25,19 @@ markup["descendants"] = `<my-component>
describe("docs/guide/metadata/restrict-content.md", () => {
it("inline validation: tags", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-component":{"flow":true,"permittedContent":["span","strong","em"]}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["tags"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: exclude", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-component":{"flow":true,"permittedContent":[{"exclude":"@heading"}]}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["exclude"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: descendants", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"footer":{"flow":true,"sectioning":true},"my-component":{"flow":true,"permittedDescendants":[{"exclude":["@sectioning","my-component"]}]}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["descendants"]);
expect(report.results).toMatchSnapshot();
......
......@@ -42,36 +42,43 @@ markup["phrasing-metadata"] = `<span>
describe("docs/guide/metadata/simple-component.md", () => {
it("inline validation: no-metadata-1", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["no-metadata-1"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: no-metadata-2", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["no-metadata-2"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: no-metadata-3", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["no-metadata-3"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: basic-metadata", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-component":{}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["basic-metadata"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: flow-metadata-1", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-component":{"flow":true}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["flow-metadata-1"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: flow--metadata-2", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-component":{"flow":true}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["flow--metadata-2"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: phrasing-metadata", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-component":{"flow":true,"phrasing":true}}],"extends":["html-validate:recommended"]});
const report = htmlvalidate.validateString(markup["phrasing-metadata"]);
expect(report.results).toMatchSnapshot();
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`docs/rules/void-content.md inline validation: correct 1`] = `Array []`;
exports[`docs/rules/void-content.md inline validation: incorrect 1`] = `
Array [
Object {
"errorCount": 1,
"filePath": "inline",
"messages": Array [
Object {
"column": 7,
"context": "img",
"line": 1,
"message": "End tag for <img> must be omitted",
"offset": 6,
"ruleId": "void-content",
"selector": null,
"severity": 2,
"size": 4,
},
],
"source": "<img></img>
<div/>",
"warningCount": 0,
},
]
`;
......@@ -10,21 +10,25 @@ markup["svg-viewbox"] = `<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/200
describe("docs/rules/attr-case.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"attr-case":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"attr-case":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: multiple", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"attr-case":["error",{"style":["lowercase","uppercase"]}]}});
const report = htmlvalidate.validateString(markup["multiple"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: svg-viewbox", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"attr-case":"error"}});
const report = htmlvalidate.validateString(markup["svg-viewbox"]);
expect(report.results).toMatchSnapshot();
......
......@@ -6,11 +6,13 @@ markup["correct"] = `<p class="foo"></p>`;
describe("docs/rules/attr-quotes.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"attr-quotes":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"attr-quotes":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -8,11 +8,13 @@ markup["correct"] = `<a href="page.html">...</a>
describe("docs/rules/attribute-allowed-values.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"attribute-allowed-values":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"attribute-allowed-values":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -7,11 +7,13 @@ markup["correct"] = `<input required>`;
describe("docs/rules/attribute-boolean-style.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"attribute-boolean-style":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"attribute-boolean-style":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -6,11 +6,13 @@ markup["correct"] = `<a download></a>`;
describe("docs/rules/attribute-empty-style.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"attribute-empty-style":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"attribute-empty-style":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -6,11 +6,13 @@ markup["correct"] = `<div class="foo-bar"></div>`;
describe("docs/rules/class-pattern.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"class-pattern":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"class-pattern":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -6,11 +6,13 @@ markup["correct"] = `<div id="foo"></div>`;
describe("docs/rules/close-attr.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"close-attr":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"close-attr":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -12,26 +12,31 @@ markup["correct-2"] = `<div></div>`;
describe("docs/rules/close-order.md", () => {
it("inline validation: incorrect-1", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"close-order":"error"}});
const report = htmlvalidate.validateString(markup["incorrect-1"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: incorrect-2", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"close-order":"error"}});
const report = htmlvalidate.validateString(markup["incorrect-2"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: incorrect-3", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"close-order":"error"}});
const report = htmlvalidate.validateString(markup["incorrect-3"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct-1", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"close-order":"error"}});
const report = htmlvalidate.validateString(markup["correct-1"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct-2", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"close-order":"error"}});
const report = htmlvalidate.validateString(markup["correct-2"]);
expect(report.results).toMatchSnapshot();
......
......@@ -8,16 +8,19 @@ markup["custom-message"] = `<my-element>...</my-element>`;
describe("docs/rules/deprecated.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"deprecated":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"deprecated":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: custom-message", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"elements":["html5",{"my-element":{"deprecated":"replaced with <other-element>"}}],"rules":{"deprecated":"error"}});
const report = htmlvalidate.validateString(markup["custom-message"]);
expect(report.results).toMatchSnapshot();
......
......@@ -7,16 +7,19 @@ markup["correct"] = `<!DOCTYPE html>`;
describe("docs/rules/doctype-html.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"doctype-html":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: legacy", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"doctype-html":"error"}});
const report = htmlvalidate.validateString(markup["legacy"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"doctype-html":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -10,21 +10,25 @@ markup["multiple"] = `<foo-bar></foo-bar>
describe("docs/rules/element-case.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-case":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-case":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: matching", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-case":["error",{"style":"pascalcase"}]}});
const report = htmlvalidate.validateString(markup["matching"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: multiple", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-case":["error",{"style":["lowercase","pascalcase"]}]}});
const report = htmlvalidate.validateString(markup["multiple"]);
expect(report.results).toMatchSnapshot();
......
......@@ -7,11 +7,13 @@ markup["correct"] = `<div></div>
describe("docs/rules/element-name.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-name":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-name":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -11,11 +11,13 @@ markup["correct"] = `<ul>
describe("docs/rules/element-permitted-content.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-permitted-content":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-permitted-content":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -12,11 +12,13 @@ markup["correct"] = `<table>
describe("docs/rules/element-permitted-occurrences.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-permitted-occurrences":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-permitted-occurrences":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -13,11 +13,13 @@ markup["correct"] = `<table>
describe("docs/rules/element-permitted-order.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-permitted-order":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-permitted-order":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -7,11 +7,13 @@ markup["correct"] = `<input type="">
describe("docs/rules/element-required-attributes.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-required-attributes":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-required-attributes":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -14,11 +14,13 @@ markup["correct"] = `<html>
describe("docs/rules/element-required-content.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-required-content":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"element-required-content":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -9,16 +9,19 @@ markup["whitespace"] = `<h1> </h1>`;
describe("docs/rules/empty-heading.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"empty-heading":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"empty-heading":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: whitespace", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"empty-heading":"error"}});
const report = htmlvalidate.validateString(markup["whitespace"]);
expect(report.results).toMatchSnapshot();
......
......@@ -13,16 +13,19 @@ markup["whitespace"] = `<head>
describe("docs/rules/empty-title.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"empty-title":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"empty-title":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: whitespace", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"empty-title":"error"}});
const report = htmlvalidate.validateString(markup["whitespace"]);
expect(report.results).toMatchSnapshot();
......
......@@ -8,11 +8,13 @@ markup["correct"] = `<h1>Heading 1</h1>
describe("docs/rules/heading-level.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"heading-level":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"heading-level":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -6,11 +6,13 @@ markup["correct"] = `<div id="foo-bar"></div>`;
describe("docs/rules/id-pattern.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"id-pattern":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"id-pattern":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -29,11 +29,13 @@ markup["correct"] = `<!-- label with descendant -->
describe("docs/rules/input-missing-label.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"input-missing-label":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"input-missing-label":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -10,11 +10,13 @@ markup["correct"] = `<head>
describe("docs/rules/long-title.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"long-title":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"long-title":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -7,16 +7,19 @@ markup["correct"] = `<meta http-equiv="refresh" content="0;url=target.html">`;
describe("docs/rules/meta-refresh.md", () => {
it("inline validation: incorrect-delay", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"meta-refresh":"error"}});
const report = htmlvalidate.validateString(markup["incorrect-delay"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: incorrect-url", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"meta-refresh":"error"}});
const report = htmlvalidate.validateString(markup["incorrect-url"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"meta-refresh":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -11,11 +11,13 @@ markup["correct"] = `<!doctype html>
describe("docs/rules/missing-doctype.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"missing-doctype":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"missing-doctype":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -11,6 +11,7 @@ markup["incorrect"] = `<!--[if IE]>
describe("docs/rules/no-conditional-comment.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-conditional-comment":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
......
......@@ -6,11 +6,13 @@ markup["correct"] = `<body style="background: red;"></body>`;
describe("docs/rules/no-deprecated-attr.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-deprecated-attr":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-deprecated-attr":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -6,11 +6,13 @@ markup["correct"] = `<div class="foo bar"></div>`;
describe("docs/rules/no-dup-attr.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-dup-attr":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-dup-attr":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -6,11 +6,13 @@ markup["correct"] = `<div class="foo bar"></div>`;
describe("docs/rules/no-dup-class.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-dup-class":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-dup-class":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -8,11 +8,13 @@ markup["correct"] = `<div id="foo"></div>
describe("docs/rules/no-dup-id.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-dup-id":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-dup-id":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -21,26 +21,31 @@ markup["correct-paragraph"] = `<p>lorem ipsum</p>
describe("docs/rules/no-implicit-close.md", () => {
it("inline validation: parent", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-implicit-close":"error"}});
const report = htmlvalidate.validateString(markup["parent"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: siblings", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-implicit-close":"error"}});
const report = htmlvalidate.validateString(markup["siblings"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: adjacent", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-implicit-close":"error"}});
const report = htmlvalidate.validateString(markup["adjacent"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct-list", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-implicit-close":"error"}});
const report = htmlvalidate.validateString(markup["correct-list"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct-paragraph", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-implicit-close":"error"}});
const report = htmlvalidate.validateString(markup["correct-paragraph"]);
expect(report.results).toMatchSnapshot();
......
......@@ -6,11 +6,13 @@ markup["correct"] = `<p class="error"></p>`;
describe("docs/rules/no-inline-style.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-inline-style":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-inline-style":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -12,11 +12,13 @@ markup["correct"] = `<label for="my-input"></label>
describe("docs/rules/no-missing-references.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-missing-references":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-missing-references":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -21,21 +21,25 @@ markup["relaxed"] = `<!-- Not ambiguous: & is followed by whitespace -->
describe("docs/rules/no-raw-characters.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-raw-characters":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-raw-characters":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: malformed", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-raw-characters":"error"}});
const report = htmlvalidate.validateString(markup["malformed"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: relaxed", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-raw-characters":["error",{"relaxed":true}]}});
const report = htmlvalidate.validateString(markup["relaxed"]);
expect(report.results).toMatchSnapshot();
......
......@@ -12,11 +12,13 @@ markup["correct"] = `<ul>
describe("docs/rules/no-redundant-role.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-redundant-role":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-redundant-role":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -14,21 +14,25 @@ markup["xml"] = `<xi:include/>`;
describe("docs/rules/no-self-closing.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-self-closing":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-self-closing":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: foreign", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-self-closing":["error",{"ignoreForeign":false}]}});
const report = htmlvalidate.validateString(markup["foreign"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: xml", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-self-closing":["error",{"ignoreXML":false}]}});
const report = htmlvalidate.validateString(markup["xml"]);
expect(report.results).toMatchSnapshot();
......
......@@ -10,11 +10,13 @@ markup["correct"] = `<link rel="stylesheet" src="my-style.css">`;
describe("docs/rules/no-style-tag.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-style-tag":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-style-tag":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......
......@@ -6,11 +6,13 @@ markup["correct"] = `<div></div>`;
describe("docs/rules/no-unknown-elements.md", () => {
it("inline validation: incorrect", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-unknown-elements":"error"}});
const report = htmlvalidate.validateString(markup["incorrect"]);
expect(report.results).toMatchSnapshot();
});
it("inline validation: correct", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate({"rules":{"no-unknown-elements":"error"}});
const report = htmlvalidate.validateString(markup["correct"]);
expect(report.results).toMatchSnapshot();
......