From f235939f0ba0c99021afc481b1a2c1aef684f894 Mon Sep 17 00:00:00 2001 From: OnkarRuikar <87750369+OnkarRuikar@users.noreply.github.com> Date: Wed, 26 Apr 2023 20:25:15 +0530 Subject: [PATCH] run unit tests on commit --- .github/workflows/pr-check_markdownlint.yml | 1 + .lintstagedrc.json | 1 + tests/front-matter_test_files/config.json | 16 ---------------- .../double_quotes.valid.md | 2 +- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pr-check_markdownlint.yml b/.github/workflows/pr-check_markdownlint.yml index 4565921bba6b3ae..ec21082e0b97b32 100644 --- a/.github/workflows/pr-check_markdownlint.yml +++ b/.github/workflows/pr-check_markdownlint.yml @@ -43,4 +43,5 @@ jobs: echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json" files_to_lint="${{ env.DIFF_DOCUMENTS }}" yarn markdownlint-cli2 ${files_to_lint} + echo "Linting front-matter" node scripts/front-matter_linter.js ${files_to_lint} diff --git a/.lintstagedrc.json b/.lintstagedrc.json index e0a16e9c5ccac79..8f677173ceaa7f0 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -4,5 +4,6 @@ "markdownlint-cli2-fix", "node scripts/front-matter_linter.js --fix true" ], + "tests/**/*.*": "yarn test:front-matter-linter", "*.{svg,png,jpeg,jpg,gif}": "yarn filecheck" } diff --git a/tests/front-matter_test_files/config.json b/tests/front-matter_test_files/config.json index 894dd60f69518f2..cc6be4bb734efe8 100644 --- a/tests/front-matter_test_files/config.json +++ b/tests/front-matter_test_files/config.json @@ -68,22 +68,6 @@ } } } - }, - { - "if": { - "properties": { "slug": { "type": "string", "pattern": "^MDN/" } } - }, - "then": { - "properties": { - "page-type": { - "enum": [ - "landing-page", - "mdn-community-guide", - "mdn-writing-guide" - ] - } - } - } } ] }, diff --git a/tests/front-matter_test_files/double_quotes.valid.md b/tests/front-matter_test_files/double_quotes.valid.md index aee95327aab7e8a..c3d9a16e3629cbb 100644 --- a/tests/front-matter_test_files/double_quotes.valid.md +++ b/tests/front-matter_test_files/double_quotes.valid.md @@ -1,5 +1,5 @@ --- -title: 'some api: method() is "cool"' +title: "some api: method() is \"cool\"" short-title: method() slug: Web/api/method ---