message: feat: check for module attributes as well
diff: @@ -35,21 +35,29 @@ describe("JSDoc contains all methods", () => {
  );
  })
  - for (const clazz of ['Database', 'QueryResult', 'Connection', 'Statement']) {
  - it(clazz, async () => {
  -
  - const prot = duckdb[clazz].prototype;
  -
  - const symbols = Object.getOwnPropertySymbols(prot).map(i => lastDot(i.description));
  - const expected = Object.getOwnPropertyNames(prot).concat(symbols).sort();
  + function checkDocs(obj, scope) {
  + const symbols = Object.getOwnPropertySymbols(obj).map(i => lastDot(i.description));
  + const expected = Object
  + .getOwnPropertyNames(obj)
  + .concat(symbols)
  + .sort()
  + .filter(name => name !== 'constructor');
  const actual = docs
  - .filter((node) => node.memberof === `module:duckdb~${clazz}` && !node.undocumented)
  + .filter((node) => node.memberof === scope && !node.undocumented)
  .map((node) => lastDot(node.name))
  - .concat(['constructor'])
  .sort();
  - expect(expected).to.deep.equals(actual, 'methods missing from documentation');
  + expect(expected).to.deep.equals(actual, 'items missing from documentation');
  + }
  +
  + for (const clazz of ['Database', 'QueryResult', 'Connection', 'Statement']) {
  + it(clazz, () => {
  + checkDocs(duckdb[clazz].prototype, `module:duckdb~${clazz}`);
  });
  }
  +
  + it('module root', () => {
  + checkDocs(duckdb, 'module:duckdb');
  + });
  });
  