()
| 1959 | } |
| 1960 | |
| 1961 | async function printSimpleStatistics() { |
| 1962 | { |
| 1963 | let countScanURLExternal = 0 |
| 1964 | let countScanURLInternal = 0 |
| 1965 | |
| 1966 | await forEachCatalogUrl((catalogUrl) => { |
| 1967 | catalogUrl.startsWith(SchemaStoreUrls[0]) || |
| 1968 | catalogUrl.startsWith(SchemaStoreUrls[1]) |
| 1969 | ? countScanURLInternal++ |
| 1970 | : countScanURLExternal++ |
| 1971 | }) |
| 1972 | |
| 1973 | const totalCount = countScanURLExternal + countScanURLInternal |
| 1974 | const percentExternal = Math.round( |
| 1975 | (countScanURLExternal / totalCount) * 100, |
| 1976 | ) |
| 1977 | |
| 1978 | console.info(`Out of ${totalCount} TOTAL schemas:`) |
| 1979 | console.info( |
| 1980 | `- ${countScanURLInternal} (${100 - percentExternal}%) are SchemaStore URLs`, |
| 1981 | ) |
| 1982 | console.info( |
| 1983 | `- ${countScanURLExternal} (${percentExternal}%) are External URLs`, |
| 1984 | ) |
| 1985 | console.info() |
| 1986 | } |
| 1987 | |
| 1988 | { |
| 1989 | let totalSchemas = 0 |
| 1990 | let validatingInStrictMode = 0 |
| 1991 | let totalPositiveTests = 0 |
| 1992 | let totalNegativeTests = 0 |
| 1993 | |
| 1994 | for (const schemaName of SchemasToBeTested) { |
| 1995 | if (SchemaValidation.skiptest.includes(schemaName)) { |
| 1996 | continue |
| 1997 | } |
| 1998 | |
| 1999 | totalSchemas += 1 |
| 2000 | |
| 2001 | if (SchemaValidation.ajvNotStrictMode.includes(schemaName)) { |
| 2002 | validatingInStrictMode += 1 |
| 2003 | } |
| 2004 | |
| 2005 | if (FoldersPositiveTest.includes(schemaName.replace('.json', ''))) { |
| 2006 | totalPositiveTests += 1 |
| 2007 | } |
| 2008 | |
| 2009 | if (FoldersNegativeTest.includes(schemaName.replace('.json', ''))) { |
| 2010 | totalNegativeTests += 1 |
| 2011 | } |
| 2012 | } |
| 2013 | |
| 2014 | const strictModePercent = Math.round( |
| 2015 | (validatingInStrictMode / totalSchemas) * 100, |
| 2016 | ) |
| 2017 | const positivePercent = Math.round( |
| 2018 | (totalPositiveTests / totalSchemas) * 100, |
no test coverage detected