Commits (22)
......@@ -28,7 +28,8 @@
"rules": {
"sonarjs/no-duplicate-string": "off",
"sonarjs/no-identical-functions": "off",
"@typescript-eslint/no-non-null-assertion": "off"
"@typescript-eslint/no-non-null-assertion": "off",
"tsdoc/syntax": "off"
}
}
]
......
......@@ -102,7 +102,7 @@ Docs:
before_script:
- npm ci
script:
- npm test
- npm test -- --no-coverage --testPathIgnorePatterns matchers tests/jest
- npm run --if-present build
- npm run compatibility
......@@ -122,6 +122,19 @@ Node 16.x (current):
<<: *compat
image: node:16
Jest compat:
stage: compatibility
dependencies: []
needs: []
parallel:
matrix:
- VERSION: [24, 25, 26, 27]
before_script:
- npm ci
- npm install --force jest@${VERSION}.0.0 ts-jest@${VERSION}.0.0
script:
- npm exec jest -- --no-coverage matchers tests/jest
Release:
stage: release
only:
......
# html-validate changelog
## [4.13.0](https://gitlab.com/html-validate/html-validate/compare/v4.12.0...v4.13.0) (2021-05-28)
### Features
- **jest:** better compatibility with jest in node environment ([79d14ca](https://gitlab.com/html-validate/html-validate/commit/79d14ca23bacf6848ce67b6f4ec853bbfee5f5a6))
### Dependency upgrades
- **deps:** support jest v27 ([863f73d](https://gitlab.com/html-validate/html-validate/commit/863f73dfec245a1a806bb7a6690fbc633887a334))
- **deps:** update dependency @sidvind/better-ajv-errors to ^0.9.0 ([8f6d162](https://gitlab.com/html-validate/html-validate/commit/8f6d1628a9dcc8554b17a37a31e29cdb98f2dd01))
## [4.12.0](https://gitlab.com/html-validate/html-validate/compare/v4.11.0...v4.12.0) (2021-05-17)
### Features
......
......@@ -21,3 +21,5 @@ new issue](https://gitlab.com/html-validate/html-validate/issues/new).
For questions about the project feel free to contact the project owner at
[contact@html-validate.org](mailto:contact@html-validate.org).
Support is also available at IRC libera.chat [#html-validate](https://kiwiirc.com/client/irc.libera.chat/#html-validate).
$fa-font-path: "fonts";
$icon-font-path: "fonts/";
@use "sass:math";
@import "font-awesome";
@import "bootstrap";
@import "hljs-github";
......@@ -62,8 +64,8 @@ table {
.messages {
border-top: 1px solid $pre-border-color;
margin-top: ($line-height-computed - 1) / 2;
padding-top: ($line-height-computed - 1) / 2;
margin-top: math.div($line-height-computed - 1, 2);
padding-top: math.div($line-height-computed - 1, 2);
pre {
color: $code-color;
......
This diff is collapsed.
{
"name": "html-validate",
"version": "4.12.0",
"version": "4.13.0",
"description": "html linter",
"keywords": [
"html",
......@@ -120,7 +120,7 @@
"dependencies": {
"@babel/code-frame": "^7.10.0",
"@html-validate/stylish": "^1.0.0",
"@sidvind/better-ajv-errors": "^0.8.0",
"@sidvind/better-ajv-errors": "^0.9.0",
"acorn-walk": "^8.0.0",
"ajv": "^7.0.0",
"deepmerge": "^4.2.0",
......@@ -133,7 +133,7 @@
"prompts": "^2.0.0"
},
"devDependencies": {
"@babel/core": "7.14.2",
"@babel/core": "7.14.3",
"@babel/preset-env": "7.14.2",
"@commitlint/cli": "12.1.4",
"@html-validate/commitlint-config": "1.3.1",
......@@ -153,46 +153,54 @@
"@types/json-merge-patch": "0.0.5",
"@types/minimist": "1.2.1",
"@types/node": "11.15.54",
"@types/prompts": "2.0.11",
"autoprefixer": "10.2.5",
"@types/prompts": "2.0.12",
"autoprefixer": "10.2.6",
"babar": "0.2.0",
"babelify": "10.0.0",
"bootstrap-sass": "3.4.1",
"canonical-path": "1.0.0",
"cssnano": "5.0.2",
"cssnano": "5.0.4",
"dgeni": "0.4.14",
"dgeni-front-matter": "2.0.3",
"dgeni-packages": "0.29.1",
"eslint": "7.26.0",
"eslint": "7.27.0",
"eslint-plugin-security": "1.4.0",
"eslint-plugin-sonarjs": "0.7.0",
"font-awesome": "4.7.0",
"front-matter": "4.0.2",
"grunt": "1.4.0",
"grunt": "1.4.1",
"grunt-browserify": "6.0.0",
"grunt-cli": "1.4.2",
"grunt-cli": "1.4.3",
"grunt-contrib-connect": "3.0.0",
"grunt-contrib-copy": "1.0.0",
"grunt-sass": "3.1.0",
"highlight.js": "10.7.2",
"husky": "6.0.0",
"jest": "26.6.3",
"jest-diff": "26.6.2",
"jest": "27.0.1",
"jest-diff": "27.0.1",
"jquery": "3.6.0",
"lint-staged": "11.0.0",
"load-grunt-tasks": "5.1.0",
"marked": "2.0.3",
"marked": "2.0.6",
"minimatch": "3.0.4",
"npm-pkg-lint": "1.3.0",
"postcss": "8.2.15",
"postcss": "8.3.0",
"prettier": "2.3.0",
"pretty-format": "26.6.2",
"sass": "1.32.13",
"pretty-format": "27.0.1",
"sass": "1.34.0",
"semantic-release": "17.4.3",
"serve-static": "1.14.1",
"stringmap": "0.2.2",
"ts-jest": "26.5.6",
"typescript": "4.2.4"
"ts-jest": "27.0.1",
"typescript": "4.3.2"
},
"peerDependencies": {
"jest": "^24 || ^25 || ^26 || ^27"
},
"peerDependenciesMeta": {
"jest": {
"optional": true
}
},
"engines": {
"node": ">= 10.0"
......
/**
* @jest-environment jsdom
*/
jest.mock("./config/default", () => {
return {
extends: ["html-validate:recommended"],
......
/* eslint-disable @typescript-eslint/no-namespace, @typescript-eslint/ban-ts-comment, prefer-template, sonarjs/no-duplicate-string */
import diff from "jest-diff";
import * as jestDiff from "jest-diff";
import deepmerge from "deepmerge";
import { TokenType } from "./lexer";
import { Message, Report, Result } from "./reporter";
......@@ -13,6 +13,9 @@ interface TokenMatcher {
data?: any;
}
/* istanbul ignore next: covered by compatibility tests but not a single pass */
const diff = jestDiff?.diff ?? jestDiff;
declare global {
namespace jest {
/* eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-unused-vars */
......@@ -172,7 +175,7 @@ function toHTMLValidate(
arg2?: string
): jest.CustomMatcherResult {
// @ts-ignore DOM library not available
if (actual instanceof HTMLElement) {
if (typeof HTMLElement !== "undefined" && actual instanceof HTMLElement) {
actual = actual.outerHTML;
}
......
/**
* @jest-environment jsdom
*/
import "../../src/matchers";
it("should validate ok", () => {
......