| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f05fb28 commit 90ab54a
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,14 +5,21 @@ function runESModuleTests() { | |||
| 5 | 5 | // Test 1: Load .mjs files as ES modules | |
| 6 | 6 | console.log("\n--- Test 1: Loading .mjs files as ES modules ---"); | |
| 7 | 7 | try { | |
| 8 | - var moduleExports = require("~/test-es-module.mjs"); | ||
| 8 | + var moduleExports = require("~/testSimpleESModule.mjs"); | ||
| 9 | 9 | if (moduleExports && moduleExports !== null) { | |
| 10 | 10 | console.log("Module exports:", JSON.stringify(moduleExports)); | |
| 11 | 11 | passed++; | |
| 12 | 12 | } else { | |
| 13 | 13 | console.log("❌ FAIL: ES Module loaded but exports are null"); | |
| 14 | 14 | failed++; | |
| 15 | 15 | } | |
| 16 | + if (moduleExports.moduleType === "ES Module") { | ||
| 17 | + console.log(" - moduleType check passed"); | ||
| 18 | + passed++; | ||
| 19 | + } else { | ||
| 20 | + console.log("❌ FAIL: moduleType check failed"); | ||
| 21 | + failed++; | ||
| 22 | + } | ||
| 16 | 23 | } catch (e) { | |
| 17 | 24 | console.log("❌ FAIL: Error loading ES module:", e.message); | |
| 18 | 25 | failed++; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -223,7 +223,7 @@ public Runtime(StaticConfiguration config, DynamicConfiguration dynamicConfigura | |||
| 223 | 223 | ||
| 224 | 224 | gcListener = GcListener.getInstance(config.appConfig.getGcThrottleTime(), config.appConfig.getMemoryCheckInterval(), config.appConfig.getFreeMemoryRatio()); | |
| 225 | 225 | // capture static configuration to allow native lookups when currentRuntime is unavailable | |
| 226 | - Runtime.staticConfiguration = config; | ||
| 226 | + staticConfiguration = config; | ||
| 227 | 227 | } finally { | |
| 228 | 228 | frame.close(); | |
| 229 | 229 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ function checkTestResults() { | |||
| 20 | 20 | ||
| 21 | 21 | // Track different types of test results | |
| 22 | 22 | const testResults = { | |
| 23 | - esModules: { passed: false, failed: false }, | ||
| 23 | + esModules: { passed: false, failed: false, total: 0, passedCount: 0, failedCount: 0 }, | ||
| 24 | 24 | jasmine: { specs: 0, failures: 0 }, | |
| 25 | 25 | manual: { tests: [], failures: [] }, | |
| 26 | 26 | general: { passes: 0, failures: 0 } | |
@@ -29,6 +29,13 @@ function checkTestResults() { | |||
| 29 | 29 | // Look for ES Module test results | |
| 30 | 30 | testResults.esModules.passed = logcatOutput.includes('ALL ES MODULE TESTS PASSED!'); | |
| 31 | 31 | testResults.esModules.failed = logcatOutput.includes('SOME ES MODULE TESTS FAILED!'); | |
| 32 | + // Parse ES Module counts if present | ||
| 33 | + const esmPassedMatch = logcatOutput.match(/Tests passed:\s*(\d+)/); | ||
| 34 | + const esmFailedMatch = logcatOutput.match(/Tests failed:\s*(\d+)/); | ||
| 35 | + const esmTotalMatch = logcatOutput.match(/Total tests:\s*(\d+)/); | ||
| 36 | + if (esmPassedMatch) testResults.esModules.passedCount = parseInt(esmPassedMatch[1], 10); | ||
| 37 | + if (esmFailedMatch) testResults.esModules.failedCount = parseInt(esmFailedMatch[1], 10); | ||
| 38 | + if (esmTotalMatch) testResults.esModules.total = parseInt(esmTotalMatch[1], 10); | ||
| 32 | 39 | ||
| 33 | 40 | // Look for Jasmine test results | |
| 34 | 41 | const jasmineSuccessMatch = logcatOutput.match(/SUCCESS:\s*(\d+)\s+specs?,\s*(\d+)\s+failures?/); | |
@@ -83,10 +90,15 @@ function checkTestResults() { | |||
| 83 | 90 | console.log('='.repeat(50)); | |
| 84 | 91 | ||
| 85 | 92 | // ES Module tests | |
| 86 | - if (testResults.esModules.passed) { | ||
| 87 | - console.log('✅ ES Module Tests: PASSED'); | ||
| 88 | - } else if (testResults.esModules.failed) { | ||
| 89 | - console.log('❌ ES Module Tests: FAILED'); | ||
| 93 | + if (testResults.esModules.passed || testResults.esModules.failed) { | ||
| 94 | + const esmCounts = testResults.esModules.total | ||
| 95 | + ? ` (${testResults.esModules.passedCount}/${testResults.esModules.total} passed, ${testResults.esModules.failedCount} failed)` | ||
| 96 | + : ''; | ||
| 97 | + if (testResults.esModules.passed) { | ||
| 98 | + console.log(`✅ ES Module Tests: PASSED${esmCounts}`); | ||
| 99 | + } else if (testResults.esModules.failed) { | ||
| 100 | + console.log(`❌ ES Module Tests: FAILED${esmCounts}`); | ||
| 101 | + } | ||
| 90 | 102 | } else { | |
| 91 | 103 | console.log('ES Module Tests: No clear results found'); | |
| 92 | 104 | } | |
@@ -115,6 +127,14 @@ function checkTestResults() { | |||
| 115 | 127 | console.log(`📈 General Results: ${testResults.general.passes} passes, ${testResults.general.failures} failures`); | |
| 116 | 128 | } | |
| 117 | 129 | ||
| 130 | + // Totals across detected test suites | ||
| 131 | + const totalDetectedTests = (testResults.jasmine.specs || 0) + (testResults.esModules.total || 0); | ||
| 132 | + if (totalDetectedTests > 0) { | ||
| 133 | + const totalFailures = (testResults.jasmine.failures || 0) + (testResults.esModules.failedCount || 0); | ||
| 134 | + console.log(`—`); | ||
| 135 | + console.log(`🧮 Total Detected Tests: ${totalDetectedTests} (Jasmine: ${testResults.jasmine.specs || 0}, ES Modules: ${testResults.esModules.total || 0})`); | ||
| 136 | + console.log(` Total Failures: ${totalFailures}`); | ||
| 137 | + } | ||
| 118 | 138 | console.log('='.repeat(50)); | |
| 119 | 139 | ||
| 120 | 140 | // Show recent test output for debugging | |
@@ -141,6 +161,9 @@ function checkTestResults() { | |||
| 141 | 161 | logContent.includes('SUCCESS:') || | |
| 142 | 162 | logContent.includes('FAILURE:') || | |
| 143 | 163 | logContent.includes('ES MODULE') || | |
| 164 | + logContent.includes('Total tests:') || | ||
| 165 | + logContent.includes('Tests passed:') || | ||
| 166 | + logContent.includes('Tests failed:') || | ||
| 144 | 167 | logContent.includes('FAILED TEST:') || | |
| 145 | 168 | logContent.includes('Suite:') || | |
| 146 | 169 | logContent.includes('File:') || | |
| Back | FazBrowse Home | New Git URL |
0 commit comments