Skip to content

Commit 009f475

Browse files
committed
add more tests
1 parent 60479e7 commit 009f475

File tree

7 files changed

+34
-0
lines changed

7 files changed

+34
-0
lines changed

tsdoc-config/src/__tests__/TSDocConfigFile.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,20 @@ test('p10 reportUnsupportedHtmlElements is overridden by "false"', () => {
743743
expect(flattened.validation.reportUnsupportedHtmlElements).toEqual(true);
744744
});
745745

746+
test('p11 reportUnsupportedHtmlElements is handled correctly with multiple parent configs', () => {
747+
const configFile: TSDocConfigFile = TSDocConfigFile.loadForFolder(path.join(__dirname, 'assets/p11'));
748+
const flattened = new TSDocConfiguration();
749+
configFile.updateParser(flattened);
750+
expect(flattened.validation.reportUnsupportedHtmlElements).toEqual(true);
751+
});
752+
753+
test('p12 reportUnsupportedHtmlElements can be set to false, even when "supportedHtmlElements" is present', () => {
754+
const configFile: TSDocConfigFile = TSDocConfigFile.loadForFolder(path.join(__dirname, 'assets/p12'));
755+
const flattened = new TSDocConfiguration();
756+
configFile.updateParser(flattened);
757+
expect(flattened.validation.reportUnsupportedHtmlElements).toEqual(false);
758+
});
759+
746760
test('Test loadFromObject()', () => {
747761
const configuration: TSDocConfiguration = new TSDocConfiguration();
748762
configuration.clear(true);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
3+
"reportUnsupportedHtmlElements": false
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
3+
"supportedHtmlElements": []
4+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
3+
"extends": ["./base1/tsdoc-base1.json"],
4+
"reportUnsupportedHtmlElements": true
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
3+
"supportedHtmlElements": [],
4+
"reportUnsupportedHtmlElements": false
5+
}

0 commit comments

Comments
 (0)