Skip to content

Commit

Permalink
fix(testing): cleanup e2e atomization plugins (#21688)
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder authored Feb 7, 2024
1 parent 1dd3637 commit ebbb2f0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/cypress/plugins/cypress-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { dirname, join, relative } from 'path';
import { lstatSync } from 'fs';

import vitePreprocessor from '../src/plugins/preprocessor-vite';
import { NX_PLUGIN_OPTIONS } from '../src/utils/symbols';
import { NX_PLUGIN_OPTIONS } from '../src/utils/constants';

import { exec } from 'child_process';
import { request as httpRequest } from 'http';
Expand Down
2 changes: 1 addition & 1 deletion packages/cypress/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { existsSync, readdirSync } from 'fs';
import { globWithWorkspaceContext } from 'nx/src/utils/workspace-context';
import { calculateHashForCreateNodes } from '@nx/devkit/src/utils/calculate-hash-for-create-nodes';
import { projectGraphCacheDirectory } from 'nx/src/utils/cache-directory';
import { NX_PLUGIN_OPTIONS } from '../utils/symbols';
import { NX_PLUGIN_OPTIONS } from '../utils/constants';
import { loadConfigFile } from '@nx/devkit/src/utils/config-utils';

export interface CypressPluginOptions {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
* Key used to store options used by the nx plugin for @nx/cypress.
*/
export const NX_PLUGIN_OPTIONS = Symbol('Nx Plugin Options');
export const NX_PLUGIN_OPTIONS = '__NxPluginOptions__';
5 changes: 4 additions & 1 deletion packages/playwright/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
CreateNodesContext,
detectPackageManager,
joinPathFragments,
normalizePath,
readJsonFile,
TargetConfiguration,
writeJsonFile,
Expand Down Expand Up @@ -157,7 +158,9 @@ async function buildPlaywrightTargets(
const dependsOn: TargetConfiguration['dependsOn'] = [];
forEachTestFile(
(testFile) => {
const relativeToProjectRoot = relative(projectRoot, testFile);
const relativeToProjectRoot = normalizePath(
relative(projectRoot, testFile)
);
const targetName = `${options.ciTargetName}--${relativeToProjectRoot}`;
targets[targetName] = {
...ciBaseTargetConfig,
Expand Down

0 comments on commit ebbb2f0

Please sign in to comment.