From 9f8830142bc99e372bad7491f6ee89ec95832e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Tue, 5 Mar 2024 15:16:55 +0100 Subject: [PATCH] fix(testing): resolve cypress config glob pattern correctly to handle root projects --- packages/cypress/src/utils/config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cypress/src/utils/config.ts b/packages/cypress/src/utils/config.ts index 7f96fed552eed..43862c659c058 100644 --- a/packages/cypress/src/utils/config.ts +++ b/packages/cypress/src/utils/config.ts @@ -1,4 +1,4 @@ -import { glob, type Tree } from '@nx/devkit'; +import { glob, joinPathFragments, type Tree } from '@nx/devkit'; import type { InterfaceDeclaration, MethodSignature, @@ -168,7 +168,7 @@ export function getProjectCypressConfigPath( projectRoot: string ): string { const cypressConfigPaths = glob(tree, [ - `${projectRoot}/${CYPRESS_CONFIG_FILE_NAME_PATTERN}`, + joinPathFragments(projectRoot, CYPRESS_CONFIG_FILE_NAME_PATTERN), ]); if (cypressConfigPaths.length === 0) { throw new Error(`Could not find a cypress config file in ${projectRoot}.`);