-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexandru Bereghici
committed
Sep 17, 2023
1 parent
4e38b2f
commit 3bf824d
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Standard HTML - W3C Validator | ||
|
||
_Check if your HTML is compliant with W3C standards_ | ||
|
||
## Setup | ||
|
||
Install package: | ||
|
||
```shell | ||
$ 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: | ||
|
||
<img src=https://raw.githubusercontent.com/abereghici/standard-html/main/example.png width=800 alt=screenshot> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "standard-html", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Check if your HTML is compliant with W3C standards", | ||
"license": "MIT", | ||
"author": "Alexandru Bereghici <[email protected]>", | ||
|