From 2d7b69379277e3ce9237238ab4d5e7d81d9fc28d Mon Sep 17 00:00:00 2001 From: Borja Ruiz Date: Wed, 30 Jan 2019 11:05:45 +0100 Subject: [PATCH] Chore: Add spellcheck and crossorigin to default html ignore list --- packages/hint-compat-api/src/helpers/compat-html.ts | 2 +- .../tests/fixtures/html/link-crossorigin.html | 1 + .../tests/fixtures/html/spellcheck.html | 1 + packages/hint-compat-api/tests/html-next.ts | 11 +++++++++-- 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 packages/hint-compat-api/tests/fixtures/html/link-crossorigin.html create mode 100644 packages/hint-compat-api/tests/fixtures/html/spellcheck.html diff --git a/packages/hint-compat-api/src/helpers/compat-html.ts b/packages/hint-compat-api/src/helpers/compat-html.ts index bdbb0a4d7b7..688a74cc694 100644 --- a/packages/hint-compat-api/src/helpers/compat-html.ts +++ b/packages/hint-compat-api/src/helpers/compat-html.ts @@ -8,7 +8,7 @@ import { MDNTreeFilteredByBrowsers, TestFeatureFunction, FeatureInfo } from '../ import { CompatStatement } from '../types-mdn.temp'; import { CompatBase } from './compat-base'; -export const DEFAULT_HTML_IGNORE = ['integrity']; +export const DEFAULT_HTML_IGNORE = ['integrity', 'crossorigin', 'spellcheck']; export class CompatHTML extends CompatBase { public constructor(hintContext: HintContext, MDNData: MDNTreeFilteredByBrowsers, testFunction: TestFeatureFunction) { diff --git a/packages/hint-compat-api/tests/fixtures/html/link-crossorigin.html b/packages/hint-compat-api/tests/fixtures/html/link-crossorigin.html new file mode 100644 index 00000000000..87fcb5006ea --- /dev/null +++ b/packages/hint-compat-api/tests/fixtures/html/link-crossorigin.html @@ -0,0 +1 @@ + diff --git a/packages/hint-compat-api/tests/fixtures/html/spellcheck.html b/packages/hint-compat-api/tests/fixtures/html/spellcheck.html new file mode 100644 index 00000000000..4f86a4f81ed --- /dev/null +++ b/packages/hint-compat-api/tests/fixtures/html/spellcheck.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/hint-compat-api/tests/html-next.ts b/packages/hint-compat-api/tests/html-next.ts index a6182373635..c75f05be9db 100644 --- a/packages/hint-compat-api/tests/html-next.ts +++ b/packages/hint-compat-api/tests/html-next.ts @@ -203,11 +203,18 @@ hintRunner.testHint(hintPath, mixedFeaturedCompatibility, { hintOptions: { enable: ['integrity'] } }); -const defaultIgnoredFeaturesShould: HintTest[] = ['link-integrity', 'script-integrity'].map((filename: string) => { +const fixturesWithIgnoredFeatures = [ + 'link-integrity', + 'script-integrity', + 'link-crossorigin', + 'spellcheck' +]; + +const defaultIgnoredFeatures: HintTest[] = fixturesWithIgnoredFeatures.map((filename: string) => { return { name: `Ignored features by default should pass (${filename}).`, serverConfig: generateHTMLConfig(filename) }; }); -hintRunner.testHint(hintPath, defaultIgnoredFeaturesShould, { browserslist: ['ie 10'] }); +hintRunner.testHint(hintPath, defaultIgnoredFeatures, { browserslist: ['ie 10', 'chrome 24'] });