Test that getCustomId handles different formats correctly
()
| 41 | |
| 42 | /** Test that getCustomId handles different formats correctly */ |
| 43 | function test() { |
| 44 | expect( |
| 45 | getCustomId( |
| 46 | `The line width of each object, in units specified by widthUnits (default pixels). ` |
| 47 | )?.[2], |
| 48 | undefined, |
| 49 | 'not header' |
| 50 | ); |
| 51 | expect(getCustomId(`## Learning deck.gl`)?.[2], undefined, 'does not contain code'); |
| 52 | expect(getCustomId(`## Changes to \`TileLayer\``)?.[2], undefined, 'is not api'); |
| 53 | expect(getCustomId(`## \`pickObjects\``)?.[2], '{#pickobjects}', 'single word api'); |
| 54 | expect(getCustomId(`## \`@deck.gl/extensions\``)?.[2], undefined, 'Package name'); |
| 55 | expect( |
| 56 | getCustomId(`## \`strokeOpacity\` (Number)`)?.[2], |
| 57 | '{#strokeopacity}', |
| 58 | 'with type annotation 1' |
| 59 | ); |
| 60 | expect( |
| 61 | getCustomId(`## \`backgroundPadding:number[]\``)?.[2], |
| 62 | '{#backgroundpadding}', |
| 63 | 'with type annotation 2' |
| 64 | ); |
| 65 | expect( |
| 66 | getCustomId(`## \`onBeforeRender(gl: WebGLRenderingContext)\``)?.[2], |
| 67 | '{#onbeforerender}', |
| 68 | 'with call signature' |
| 69 | ); |
| 70 | expect( |
| 71 | getCustomId( |
| 72 | `##### \`getWidth\` ([Function](../../developer-guide/using-layers.md#accessors)|Number, optional) ` |
| 73 | )?.[2], |
| 74 | '{#getwidth}', |
| 75 | 'with extra flag' |
| 76 | ); |
| 77 | console.log('All tests pass!\n'); |
| 78 | } |
| 79 | |
| 80 | /** Traverse all files in the docs directory, append custom ids if necessary */ |
| 81 | async function main() { |
no test coverage detected
searching dependent graphs…