fix: bug in api path existence test

It was only checking for the path, but not ensuring that the method was also defined
v1.18.x
Julian Lam 4 years ago
parent 1cd2689cf6
commit 501a7b7774

@ -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`);
});
});
});

Loading…
Cancel
Save