diff --git a/src/test/README.md b/src/test/README.md index dd22b7c..111b9ef 100644 --- a/src/test/README.md +++ b/src/test/README.md @@ -228,8 +228,8 @@ In `capacitor.config.json`: { "plugins": { "Haptics": { - "style": undefined, - "duration": undefined + "style": "native", + "duration": 123 } } } @@ -245,8 +245,8 @@ import { CapacitorConfig } from '@capacitor/cli'; const config: CapacitorConfig = { plugins: { Haptics: { - style: undefined, - duration: undefined, + style: "native", + duration: 123, }, }, }; diff --git a/src/test/docs.json b/src/test/docs.json index e48e606..64742fe 100644 --- a/src/test/docs.json +++ b/src/test/docs.json @@ -425,6 +425,10 @@ { "text": "native", "name": "default" + }, + { + "text": "\"native\"", + "name": "example" } ], "docs": "Configure the style.", @@ -437,6 +441,10 @@ { "text": "1.2.3", "name": "since" + }, + { + "text": "123", + "name": "example" } ], "docs": "Configure the duration.", diff --git a/src/test/fixtures/definitions.ts b/src/test/fixtures/definitions.ts index 3644080..5e61ef0 100644 --- a/src/test/fixtures/definitions.ts +++ b/src/test/fixtures/definitions.ts @@ -11,6 +11,7 @@ declare module '@capacitor/cli' { * * @since 1.0.0 * @default native + * @example "native" */ style?: 'none' | 'native'; @@ -18,6 +19,7 @@ declare module '@capacitor/cli' { * Configure the duration. * * @since 1.2.3 + * @example 123 */ duration?: number; }; diff --git a/src/test/parse.spec.ts b/src/test/parse.spec.ts index 6e6480f..cca877c 100644 --- a/src/test/parse.spec.ts +++ b/src/test/parse.spec.ts @@ -155,19 +155,23 @@ describe('parse', () => { expect(p0.docs).toBe(`Configure the style.`); expect(p0.type).toBe(`'none' | 'native' | undefined`); expect(p0.complexTypes).toHaveLength(0); - expect(p0.tags).toHaveLength(2); + expect(p0.tags).toHaveLength(3); expect(p0.tags[0].name).toBe(`since`); expect(p0.tags[0].text).toBe(`1.0.0`); expect(p0.tags[1].name).toBe(`default`); expect(p0.tags[1].text).toBe(`native`); + expect(p0.tags[2].name).toBe(`example`); + expect(p0.tags[2].text).toBe(`"native"`); const p1 = p.properties[1]; expect(p1.name).toBe(`duration`); expect(p1.docs).toBe(`Configure the duration.`); expect(p1.type).toBe(`number | undefined`); expect(p1.complexTypes).toHaveLength(0); - expect(p1.tags).toHaveLength(1); + expect(p1.tags).toHaveLength(2); expect(p1.tags[0].name).toBe(`since`); expect(p1.tags[0].text).toBe(`1.2.3`); + expect(p1.tags[1].name).toBe(`example`); + expect(p1.tags[1].text).toBe(`123`); }); });