|
|
@@ -1,44 +1,12 @@
|
|
|
import { manifest } from '../src/manifest.js';
|
|
|
-import {
|
|
|
- testManifestMdx,
|
|
|
- formatTestReport,
|
|
|
- createProgressReporter,
|
|
|
- validateAdmonitions,
|
|
|
- formatAdmonitionReport,
|
|
|
-} from '@vendure-io/docs-provider/testing';
|
|
|
+import { runAllTests } from '@vendure-io/docs-provider/testing';
|
|
|
|
|
|
async function main() {
|
|
|
const verbose = process.argv.includes('--verbose');
|
|
|
- let hasErrors = false;
|
|
|
|
|
|
- // Validate admonition syntax
|
|
|
- console.log('Validating admonition syntax...\n');
|
|
|
- const admonitionReport = validateAdmonitions(manifest);
|
|
|
-
|
|
|
- if (admonitionReport.errors.length > 0) {
|
|
|
- console.log(formatAdmonitionReport(admonitionReport));
|
|
|
- hasErrors = true;
|
|
|
- } else {
|
|
|
- console.log(`✓ All admonitions valid (${admonitionReport.filesScanned} files scanned)\n`);
|
|
|
- }
|
|
|
-
|
|
|
- // Test MDX compilation
|
|
|
- console.log('Testing MDX files...\n');
|
|
|
-
|
|
|
- const report = await testManifestMdx(manifest, {
|
|
|
- onProgress: createProgressReporter(),
|
|
|
+ await runAllTests(manifest, {
|
|
|
+ verbose,
|
|
|
});
|
|
|
-
|
|
|
- console.log('\n');
|
|
|
- console.log(formatTestReport(report, verbose));
|
|
|
-
|
|
|
- if (report.failed > 0) {
|
|
|
- hasErrors = true;
|
|
|
- }
|
|
|
-
|
|
|
- if (hasErrors) {
|
|
|
- process.exit(1);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
main().catch((error) => {
|