Skip to content

Commit

Permalink
feat(testing): use createNodesV2 for cypress and playwright (#26301)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz authored May 31, 2024
1 parent 92718fd commit 1e7cd7e
Show file tree
Hide file tree
Showing 12 changed files with 579 additions and 457 deletions.
2 changes: 1 addition & 1 deletion packages/cypress/plugin.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { createNodes, createDependencies } from './src/plugins/plugin';
export { createNodesV2, createNodes } from './src/plugins/plugin';
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import {
CreateNodesContext,
createProjectGraphAsync,
formatFiles,
joinPathFragments,
type TargetConfiguration,
type Tree,
} from '@nx/devkit';
import { migrateExecutorToPlugin } from '@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator';
import { createNodes } from '../../plugins/plugin';
import { createNodesV2 } from '../../plugins/plugin';
import { targetOptionsToCliMap } from './lib/target-options-map';
import { upsertBaseUrl } from './lib/upsert-baseUrl';
import { addDevServerTargetToConfig } from './lib/add-dev-server-target-to-config';
Expand All @@ -31,7 +29,7 @@ export async function convertToInferred(tree: Tree, options: Schema) {
ciTargetName: 'e2e-ci',
}),
postTargetTransformer,
createNodes,
createNodesV2,
options.project
);

Expand All @@ -45,7 +43,7 @@ export async function convertToInferred(tree: Tree, options: Schema) {
ciTargetName: 'e2e-ci',
}),
postTargetTransformer,
createNodes,
createNodesV2,
options.project
);

Expand Down
10 changes: 3 additions & 7 deletions packages/cypress/src/generators/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ import {
Tree,
updateNxJson,
} from '@nx/devkit';
import {
addPluginV1 as _addPlugin,
generateCombinations,
} from '@nx/devkit/src/utils/add-plugin';
import { createNodes } from '../../plugins/plugin';
import { addPlugin as _addPlugin } from '@nx/devkit/src/utils/add-plugin';
import { createNodesV2 } from '../../plugins/plugin';
import { cypressVersion, nxVersion } from '../../utils/versions';
import { Schema } from './schema';
import { CypressPluginOptions } from '../../plugins/plugin';

function setupE2ETargetDefaults(tree: Tree) {
const nxJson = readNxJson(tree);
Expand Down Expand Up @@ -69,7 +65,7 @@ export function addPlugin(
tree,
graph,
'@nx/cypress/plugin',
createNodes,
createNodesV2,
{
targetName: ['e2e', 'cypress:e2e', 'cypress-e2e'],
openTargetName: ['open-cypress', 'cypress-open'],
Expand Down
Loading

0 comments on commit 1e7cd7e

Please sign in to comment.