Skip to content

Commit

Permalink
Add test to execute compiled type-check code for CommonJS, paralleliz…
Browse files Browse the repository at this point in the history
…e declaration tests for an overall runtime reduction.
  • Loading branch information
DavidAnson committed Jan 4, 2025
1 parent ba72efb commit b9e8531
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default [
"demo/markdown-it.min.js",
"demo/markdownlint-browser.js",
"demo/markdownlint-browser.min.js",
"example/typescript/type-check.js",
"example/typescript/type-check-*",
"test-repos/**"
]
},
Expand Down
2 changes: 1 addition & 1 deletion example/typescript/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
type-check.js
type-check-*
1 change: 0 additions & 1 deletion example/typescript/type-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { lint as lintPromise, readConfig as readConfigPromise } from "../../lib/
import { lint as lintSync, readConfig as readConfigSync } from "../../lib/exports-sync.mjs";

import assert from "assert";
// @ts-expect-error TS7016: Could not find a declaration file for module 'markdown-it-sub'.
import markdownItSub from "markdown-it-sub";
const markdownlintJsonPath = "../../.markdownlint.json";

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@
"serial-declaration": "npm run build-declaration && npm run test-declaration",
"test": "ava --timeout=30s test/markdownlint-test.mjs test/markdownlint-test-config.mjs test/markdownlint-test-custom-rules.mjs test/markdownlint-test-fixes.mjs test/markdownlint-test-helpers.mjs test/markdownlint-test-micromark.mjs test/markdownlint-test-result-object.mjs test/markdownlint-test-scenarios.mjs helpers/test.cjs",
"test-cover": "c8 --100 npm test",
"test-declaration": "cd example/typescript && tsc --module commonjs && tsc --module nodenext && node type-check.js",
"test-declaration": "npm-run-all --continue-on-error --parallel test-declaration-cts test-declaration-mts",
"test-declaration-cts": "cd example/typescript && node ../../scripts/index.mjs copy type-check.ts type-check-commonjs.cts && tsc --module commonjs --esModuleInterop type-check-commonjs.cts && node --disable-warning=ExperimentalWarning type-check-commonjs.cjs",
"test-declaration-mts": "cd example/typescript && node ../../scripts/index.mjs copy type-check.ts type-check-nodenext.mts && tsc --module nodenext type-check-nodenext.mts && node type-check-nodenext.mjs",
"test-extra": "ava --timeout=10m test/markdownlint-test-extra-parse.mjs test/markdownlint-test-extra-type.mjs",
"update-snapshots": "ava --update-snapshots test/markdownlint-test-custom-rules.mjs test/markdownlint-test-micromark.mjs test/markdownlint-test-scenarios.mjs",
"update-snapshots-test-repos": "ava --timeout=10m --update-snapshots test/markdownlint-test-repos-*.mjs",
Expand Down

0 comments on commit b9e8531

Please sign in to comment.