Skip to content

Commit 5956e06

Browse files
committed
fixup!
1 parent 0791d1e commit 5956e06

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

test/doctool/test-doc-api-json.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ function findAllKeys(obj, allKeys = new Set()) {
7777

7878
const allExpectedKeys = new Set([
7979
'added',
80-
'api',
8180
'changes',
8281
'classes',
8382
'classMethods',
@@ -97,8 +96,8 @@ const allExpectedKeys = new Set([
9796
'miscs',
9897
'modules',
9998
'name',
100-
'optional',
10199
'napiVersion',
100+
'optional',
102101
'options',
103102
'params',
104103
'pr-url',
@@ -128,18 +127,18 @@ for await (const dirent of await fs.opendir(new URL('../../out/doc/api/', import
128127
console.log('testing', jsonPath, 'based on', expectedSource);
129128

130129
const fileContent = await fs.readFile(jsonPath, 'utf8');
130+
// A proxy to check if the file is human readable is to count if it contains
131+
// at least 3 line return.
132+
assert.strictEqual(fileContent.split('\n', 3).length, 3);
131133

132134
const json = JSON.parse(fileContent);
133135

134136
assert.strictEqual(json.type, 'module');
135137
assert.strictEqual(json.source, expectedSource);
136-
137138
if (dirent.name !== 'index.md') {
138139
assert.ok(json.introduced_in || Object.values(json).at(-1)?.[0].introduced_in);
139-
assert.partialDeepStrictEqual(allExpectedKeys, findAllKeys(json));
140140
}
141-
142-
assert.deepStrictEqual(Object.keys(json).sort(), ['type', 'api', 'source', ...({
141+
assert.deepStrictEqual(Object.keys(json), ['type', 'source', ...({
143142
'addons.md': ['introduced_in', 'miscs'],
144143
'cli.md': ['introduced_in', 'miscs'],
145144
'debugger.md': ['introduced_in', 'stability', 'stabilityText', 'miscs'],
@@ -148,6 +147,7 @@ for await (const dirent of await fs.opendir(new URL('../../out/doc/api/', import
148147
'errors.md': ['introduced_in', 'classes', 'miscs'],
149148
'esm.md': ['introduced_in', 'meta', 'stability', 'stabilityText', 'properties', 'miscs'],
150149
'globals.md': ['introduced_in', 'stability', 'stabilityText', 'classes', 'methods', 'miscs'],
150+
'index.md': [],
151151
'intl.md': ['introduced_in', 'miscs'],
152152
'n-api.md': ['introduced_in', 'stability', 'stabilityText', 'miscs'],
153153
'packages.md': ['introduced_in', 'meta', 'miscs'],

tools/doc/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/doc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"name": "doc",
33
"private": true,
44
"dependencies": {
5-
"@nodejs/doc-kit": "https://github.com/nodejs/doc-kit/archive/2a4cbe3f59b4b811cb6f1de2cf13f4b7ff853286.tar.gz"
5+
"@nodejs/doc-kit": "https://github.com/nodejs/doc-kit/archive/6ec904754a43eaaff6f16346049e2a2b44faadab.tar.gz"
66
}
77
}

0 commit comments

Comments
 (0)