fix number of expected functions (#13050)

This commit is contained in:
Vadim Ogievetsky 2022-09-09 13:42:01 -07:00 committed by GitHub
parent e29e7a8434
commit d978afc5b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ const snarkdown = require('snarkdown');
const writefile = 'lib/sql-docs.js';
const MINIMUM_EXPECTED_NUMBER_OF_FUNCTIONS = 158;
const MINIMUM_EXPECTED_NUMBER_OF_FUNCTIONS = 162;
const MINIMUM_EXPECTED_NUMBER_OF_DATA_TYPES = 14;
function hasHtmlTags(str) {
@ -90,15 +90,15 @@ const readDoc = async () => {
// Make sure there are enough functions found
const numFunction = Object.keys(functionDocs).length;
if (numFunction < MINIMUM_EXPECTED_NUMBER_OF_FUNCTIONS) {
if (!(MINIMUM_EXPECTED_NUMBER_OF_FUNCTIONS <= numFunction)) {
throw new Error(
`Did not find enough function entries did the structure of '${readfile}' change? (found ${numFunction} but expected at least ${MINIMUM_EXPECTED_NUMBER_OF_FUNCTIONS})`,
);
}
// Make sure there are at least 10 data types for sanity
const numDataTypes = dataTypeDocs.length;
if (numDataTypes < MINIMUM_EXPECTED_NUMBER_OF_DATA_TYPES) {
const numDataTypes = Object.keys(dataTypeDocs).length;
if (!(MINIMUM_EXPECTED_NUMBER_OF_DATA_TYPES <= numDataTypes)) {
throw new Error(
`Did not find enough data type entries did the structure of '${readfile}' change? (found ${numDataTypes} but expected at least ${MINIMUM_EXPECTED_NUMBER_OF_DATA_TYPES})`,
);