Skip to content

Node.js based forum software built for the modern web

fix: bug in api path existence test

Julian Lam501a7b777467
diff --git a/test/api.js b/test/api.js
index 4d929743c3..3cfa700d60 100644
--- a/test/api.js
+++ b/test/api.js
@@ -235,7 +235,8 @@ describe('API', async () => {
}
const normalizedPath = pathObj.path.replace(/\/:([^\\/]+)/g, '/{$1}').replace(/\?/g, '');
- assert(schema.paths.hasOwnProperty(normalizedPath));
+ assert(schema.paths.hasOwnProperty(normalizedPath), `${pathObj.path} is not defined in schema docs`);
+ assert(schema.paths[normalizedPath].hasOwnProperty(pathObj.method), `${pathObj.path} was found in schema docs, but ${pathObj.method.toUpperCase()} method is not defined`);
});
});
});