diff --git a/src/cli_next/tasks/task-generate.ts b/src/cli_next/tasks/task-generate.ts index 34fba4d80d9..2bbcacdc6ac 100644 --- a/src/cli_next/tasks/task-generate.ts +++ b/src/cli_next/tasks/task-generate.ts @@ -146,11 +146,22 @@ const getStyleUrlBoilerplate = () => * Get the boilerplate for a spec test. */ const getSpecTestBoilerplate = (tagName: string) => -`import { ${toPascalCase(tagName)} } from './${tagName}'; +`import { newSpecPage } from '@stencil/core/testing'; +import { ${toPascalCase(tagName)} } from './${tagName}'; describe('${tagName}', () => { - it('builds', () => { - expect(new ${toPascalCase(tagName)}()).toBeTruthy(); + it('renders', async () => { + const page = await newSpecPage({ + components: [${toPascalCase(tagName)}], + html: \`<${tagName}>\`, + }); + expect(page.root).toEqualHtml(\` + <${tagName}> + + + + + \`); }); }); `;