UNPKG

@nx/react

Version:

The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides: - Integration with libraries such as Jest, Vitest, Playwright, Cypress, and Storybook. - Generators for applica

20 lines (18 loc) 729 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAppTests = getAppTests; function getAppTests(options) { return `it('should render successfully', () => { ${options.routing ? 'const { baseElement } = render(<BrowserRouter><App /></BrowserRouter>);' : 'const { baseElement } = render(<App />);'} expect(baseElement).toBeTruthy(); }); it('should have a greeting as the title', () => { ${options.routing ? 'const { getAllByText } = render(<BrowserRouter><App /></BrowserRouter>);' : 'const { getAllByText } = render(<App />);'} expect(getAllByText(new RegExp('Welcome ${options.projectName}', 'gi')).length > 0).toBeTruthy(); }); `; }