Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 58 additions & 2 deletions tests/theme/fixtures/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ export class TypedListTest extends WebpackTest {
*/

/**
* Variable demonstrating declarationTitle formatting.
* A standalone constant demonstrating declarationTitle formatting and variable rendering.
* @type {string}
*/
export const declarationTitleTest = 'pass me';
export const CONSTANT_AND_DECLARATION_TITLE_TEST = 'pass me';

/**
* Class demonstrating indexSignature rendering.
Expand Down Expand Up @@ -160,3 +160,59 @@ export class MemberGroupsTest {
*/
init() {}
}

/**
* A simple enum demonstrating enum rendering.
* @enum {number}
*/
export const EnumTest = {
/** The first option */
ONE: 1,
/** The second option */
TWO: 2,
};

/**
* A standalone function demonstrating generics outside a class.
* @template T
* @param {T} value The input value
* @returns {T} The same value
*/
export function standAloneWithGenericsTest(value) {
return value;
}

/**
* Class demonstrating Getters and Setters (Accessors).
*/
export class AccessorTest {
/**
* Gets the current configuration name.
* @returns {string}
*/
get configName() {
return '';
}

/**
* Sets the configuration name.
* @param {string} val The new name
*/
set configName(val) {}
}

/**
* A namespace demonstrating nested members.
* @namespace
*/
export const WebpackUtils = {
/**
* Merges two configurations.
* @param {object} a First config
* @param {object} b Second config
* @returns {object} Merged config
*/
merge(a, b) {
return Object.assign({}, a, b);
},
};
4 changes: 2 additions & 2 deletions tests/theme/theme.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ test('TypeDoc Theme - Edge Cases Fixture', async t => {
const project = await app.convert();
await app.generateOutputs(project);

const mdFiles = readdirSync(outputDir, { recursive: true }).filter(
f => f.endsWith('.md') && !f.endsWith('index.md')
const mdFiles = readdirSync(outputDir, { recursive: true }).filter(f =>
f.endsWith('.md')
);

if (mdFiles.length === 0) throw new Error('No markdown file generated');
Expand Down
90 changes: 90 additions & 0 deletions tests/theme/theme.test.mjs.snapshot
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
exports[`TypeDoc Theme - Edge Cases Fixture 1`] = `
# Class: \`webpack.js.org.AccessorTest\`

Class demonstrating Getters and Setters (Accessors).

## Constructors

### \`new AccessorTest()\`

* Returns: {AccessorTest}

## Properties

* \`configName\` {string} Gets the current configuration name.


---

# \`webpack.js.org.EnumTest\`

## \`ONE\`

* Type: {number}

***

## \`TWO\`

* Type: {number}


---

# Class: \`webpack.js.org.ExamplesTest\`

Class demonstrating the formatting of JSDoc example blocks.
Expand Down Expand Up @@ -207,6 +239,56 @@ Class demonstrating Webpack as a parent class.
* Returns: {WebpackTest}


---

# \`webpack.js.org.WebpackUtils\`

## \`merge(a, b)\`

* \`a\` {object} First config
* \`b\` {object} Second config
* Returns: {object} Merged config

Merges two configurations.


---

# \`webpack.js.org\`

## Namespaces

- [EnumTest](/EnumTest.md)
- [WebpackUtils](/WebpackUtils.md)

## Classes

- [AccessorTest](/AccessorTest.md)
- [ExamplesTest](/ExamplesTest.md)
- [IndexSignatureTest](/IndexSignatureTest.md)
- [MemberGroupsTest](/MemberGroupsTest.md)
- [OverloadTest](/OverloadTest.md)
- [StabilityTest](/StabilityTest.md)
- [TypedListTest](/TypedListTest.md)
- [WebpackInterface](/WebpackInterface.md)
- [WebpackTest](/WebpackTest.md)

## \`webpack.js.org.CONSTANT_AND_DECLARATION_TITLE_TEST\`

* Type: {string}

A standalone constant demonstrating declarationTitle formatting and variable rendering.

***

## \`webpack.js.org.standAloneWithGenericsTest(value)\`

* \`value\` {T} The input value
* Returns: {T} The same value

A standalone function demonstrating generics outside a class.


---

# \`webpack\` Types
Expand Down Expand Up @@ -250,6 +332,14 @@ Complex union type.

***

## Type: \`EnumTest\`

* Type: {number}

A simple enum demonstrating enum rendering.

***

## Type: \`SimpleArrayType\`

* Type: {string[]}
Expand Down