Skip to content

Commit c58975f

Browse files
committed
Update unit tests to pass again
1 parent 0160366 commit c58975f

4 files changed

Lines changed: 17 additions & 16 deletions

File tree

‎libraries/api-extractor/src/definitions/test/ApiDocumentation.test.ts‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,19 @@ describe('ApiDocumentation tests', function (): void {
6666
*/
6767

6868
assert.equal(capturedErrors.length, 8);
69-
assert.equal(capturedErrors[0].message, 'Cannot provide summary in AEDoc if @inheritdoc tag is given');
70-
assert.equal(capturedErrors[1].message, 'Unknown AEDoc tag "@badAedocTag"');
71-
assert.equal(capturedErrors[2].message, 'Unknown tag name for inline tag.');
72-
assert.equal(capturedErrors[3].message, 'Too few parameters for @link inline tag.');
69+
assert.equal(capturedErrors[0].message, 'A summary block is not allowed here, because the @inheritdoc'
70+
+ ' target provides the summary');
71+
assert.equal(capturedErrors[1].message, 'The JSDoc tag "@badAedocTag" is not supported by AEDoc');
72+
assert.equal(capturedErrors[2].message, 'Invalid call to _tokenizeInline()');
73+
assert.equal(capturedErrors[3].message, 'The {@link} tag must include a URL or API item reference');
7374
assert.equal(capturedErrors[4].message, 'Unexpected text in AEDoc comment: "can not contain a tag"');
74-
assert.equal(capturedErrors[5].message, 'More than one release tag was specified');
75-
assert.equal(
76-
capturedErrors[6].message,
77-
'An API item reference must use the notation: "@scopeName/packageName:exportName.memberName"'
75+
assert.equal(capturedErrors[5].message, 'More than one release tag (@alpha, @beta, etc) was specified');
76+
assert.equal(capturedErrors[6].message, 'An API item reference must use the notation:'
77+
+ ' "@scopeName/packageName:exportName.memberName"'
7878
);
79-
assert.equal(
80-
capturedErrors[7].message,
81-
'inheritdoc source item is deprecated. Must provide @deprecated message or remove @inheritdoc inline tag.');
82-
});
79+
assert.equal(capturedErrors[7].message, 'The @inheritdoc target has been marked as @deprecated. '
80+
+ 'Add a @deprecated message here, or else remove the @inheritdoc relationship.');
81+
});
8382

8483
it('Should parse release tag', function (): void {
8584
const expectedReleaseTag: ReleaseTag = ReleaseTag.Public;

‎libraries/api-extractor/src/generators/test/ApiFileGenerator.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('ApiFileGenerator tests', function (): void {
6363
* Errors can be found in testInputs/folder/MyClass
6464
*/
6565
assert.equal(capturedErrors.length, 2);
66-
assert.equal(capturedErrors[0].message, 'Unknown AEDoc tag "@badAedocTag"');
66+
assert.equal(capturedErrors[0].message, 'The JSDoc tag "@badAedocTag" is not supported by AEDoc');
6767
assert.equal(capturedErrors[1].message, 'Unexpected text in AEDoc comment: '
6868
+ '"(Error #1 is the bad tag) Text can no..."');
6969
});

‎libraries/api-extractor/src/test/DocElementParser.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,8 @@ describe('DocElementParser tests', function (): void {
280280
errorMessage = error;
281281
}
282282
assert.isUndefined(errorMessage);
283-
assertCapturedErrors(['Invalid @link parameter, URL must be a single string.']);
283+
assertCapturedErrors(['The {@link} tag contains additional spaces after the URL; if the URL'
284+
+ ' contains spaces, encode them using %20; for display text, use a pipe delimiter ("|")']);
284285
});
285286

286287
it('Should parse @link with API defintion reference', (): void => {
@@ -346,7 +347,7 @@ describe('DocElementParser tests', function (): void {
346347
errorMessage = error;
347348
}
348349
assert.isNotNull(errorMessage);
349-
assertCapturedErrors(['Invalid @link parameters, at most one pipe character allowed.']);
350+
assertCapturedErrors(['The {@link} tag contains more than one pipe character ("|")']);
350351
});
351352
});
352353
});

‎libraries/api-extractor/src/test/DocItemLoader.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ describe('DocItemLoader tests', function (): void {
6363

6464
assert.equal(capturedErrors.length, 2);
6565
assert.equal(capturedErrors[0].message, 'circular reference');
66-
assert.equal(capturedErrors[1].message, 'Unable to link to "Internal" API item');
66+
assert.equal(capturedErrors[1].message, 'The {@link} tag references an @internal or @alpha API item,'
67+
+ ' which will not appear in the generated documentation');
6768
TestFileComparer.assertFileMatchesExpected(outputJsonFile, expectedJsonFile);
6869
TestFileComparer.assertFileMatchesExpected(outputApiFile, expectedApiFile);
6970
});

0 commit comments

Comments
 (0)