Skip to content

Commit

Permalink
feat(react): add cypress e2e for react standalone preset (#13848)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Dec 15, 2022
1 parent 5eabd6c commit fdd04ba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions e2e/react/src/react.test.ts
Expand Up @@ -125,6 +125,10 @@ describe('React Applications', () => {
runCLI(`build ${appName}`);

checkFilesExist(`dist/apps/${appName}/index.html`);

const e2eResults = runCLI(`e2e ${appName}-e2e --no-watch`);
expect(e2eResults).toContain('All specs passed!');
expect(await killPorts()).toBeTruthy();
}, 250_000);

async function testGeneratedApp(
Expand Down
Expand Up @@ -15,5 +15,6 @@ export async function addCypress(host: Tree, options: NormalizedSchema) {
directory: options.directory,
project: options.projectName,
rootProject: options.rootProject,
bundler: options.bundler,
});
}
2 changes: 1 addition & 1 deletion packages/workspace/src/generators/preset/preset.ts
Expand Up @@ -70,7 +70,7 @@ async function createPreset(tree: Tree, options: Schema) {
standaloneConfig: options.standaloneConfig,
rootProject: true,
bundler: 'vite',
e2eTestRunner: 'none',
e2eTestRunner: 'cypress',
unitTestRunner: 'vitest',
});
} else if (options.preset === Preset.NextJs) {
Expand Down

1 comment on commit fdd04ba

@vercel
Copy link

@vercel vercel bot commented on fdd04ba Dec 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-five.vercel.app
nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev

Please sign in to comment.