Skip to content

About

Check if your HTML is compliant with W3C standards

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

Standard HTML - W3C Validator

Check if your HTML is compliant with W3C standards

Setup

Install package:

$ npm install --save-dev standard-html

Usage

Usage example using @testing-library/react and vitest

import { expect, test } from "vitest";
import { render } from "@testing-library/react";
import { validateMarkup } from "standard-html";

import App from "./App";

test("markup is valid", async () => {
  const { container } = render(<App />);

  const [violations, summary] = await validateMarkup(container);
  expect(violations).toEqual([]);
  expect(summary.length).toEqual(0);
});

Error output example:

screenshot

About

Check if your HTML is compliant with W3C standards

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages