diff --git a/packages/next/src/generators/application/application.spec.ts b/packages/next/src/generators/application/application.spec.ts index 8f0a1b2380d98..fa54ed0b95d6d 100644 --- a/packages/next/src/generators/application/application.spec.ts +++ b/packages/next/src/generators/application/application.spec.ts @@ -183,7 +183,7 @@ describe('app', () => { describe('--style scss', () => { it('should generate scss styles', async () => { - const name = 'myapp'; + const name = uniq(); await applicationGenerator(tree, { name, style: 'scss', @@ -200,7 +200,7 @@ describe('app', () => { "import './global.css'; export const metadata = { - title: 'Welcome to myapp', + title: 'Welcome to ${name}', description: 'Generated by create-nx-workspace', }; @@ -222,7 +222,7 @@ describe('app', () => { describe('--style less', () => { it('should generate less styles', async () => { - const name = 'myapp2'; + const name = uniq(); await applicationGenerator(tree, { name, style: 'less', @@ -239,7 +239,7 @@ describe('app', () => { "import './global.less'; export const metadata = { - title: 'Welcome to myapp2', + title: 'Welcome to ${name}', description: 'Generated by create-nx-workspace', }; @@ -360,12 +360,9 @@ describe('app', () => { const indexContent = tree.read(`${name}/src/app/page.tsx`, 'utf-8'); expect(indexContent).not.toContain(`import styles from './page.module`); expect(indexContent).toContain(`import styled from '@emotion/styled'`); - expect(tree.read(`${name}/src/app/layout.tsx`, 'utf-8')) - .toMatchInlineSnapshot(` - "import './global.css'; - - export const metadata = { - title: 'Welcome to `); + expect( + tree.read(`${name}/src/app/layout.tsx`, 'utf-8') + ).toMatchInlineSnapshot(``); }); it('should add jsxImportSource in tsconfig.json', async () => { @@ -605,7 +602,7 @@ describe('app', () => { describe('--linter', () => { describe('default (eslint)', () => { it('should add .eslintrc.json and dependencies', async () => { - const name = 'myapp3'; + const name = uniq(); await applicationGenerator(tree, { name, @@ -645,7 +642,7 @@ describe('app', () => { "rules": { "@next/next/no-html-link-for-pages": [ "error", - "myapp3/pages", + "${name}/pages", ], }, },