From ab2f0c1fdb9dba91ee1ffdb3bf01768c6c670f33 Mon Sep 17 00:00:00 2001 From: Matt Schile Date: Mon, 13 Jan 2025 08:33:27 -0700 Subject: [PATCH] fix: update tsconfig files to match previous config (#30856) --- cli/CHANGELOG.md | 1 + packages/app/cypress/e2e/specs_list_e2e.cy.ts | 20 +++++++++++++++++++ packages/app/tsconfig.json | 2 ++ packages/config/tsconfig.json | 3 ++- packages/data-context/tsconfig.json | 3 ++- packages/driver/tsconfig.json | 1 - packages/errors/tsconfig.json | 3 ++- packages/extension/tsconfig.json | 1 + .../graphql/src/utils/nexusTypegenUtils.ts | 2 +- packages/graphql/tsconfig.json | 1 + packages/icons/tsconfig.json | 3 ++- packages/reporter/tsconfig.json | 1 + packages/scaffold-config/tsconfig.json | 3 ++- packages/telemetry/tsconfig.json | 1 + packages/ts/tsconfig.json | 6 +++--- 15 files changed, 41 insertions(+), 10 deletions(-) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 7443b288e350..79ff8a0fd828 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -55,6 +55,7 @@ in this [GitHub issue](https://github.com/cypress-io/cypress/issues/30447). Addr - Fixed a visibility issue for elements with `textContent` but without a width or height. Fixed in [#29688](https://github.com/cypress-io/cypress/pull/29688). Fixes [#29687](https://github.com/cypress-io/cypress/issues/29687). - Elements whose parent elements has `overflow: clip` and no height/width will now correctly show as hidden. Fixed in [#29778](https://github.com/cypress-io/cypress/pull/29778). Fixes [#23852](https://github.com/cypress-io/cypress/issues/23852). - The CSS pseudo-class `:dir()` is now supported when testing in Electron. Addresses [#29766](https://github.com/cypress-io/cypress/issues/29766). +- Fixed an issue where the spec filename was not updating correctly when changing specs in `open` mode. Fixes [#30852](https://github.com/cypress-io/cypress/issues/30852). **Misc:** diff --git a/packages/app/cypress/e2e/specs_list_e2e.cy.ts b/packages/app/cypress/e2e/specs_list_e2e.cy.ts index 03cfd8fbe936..51fbd1734f0f 100644 --- a/packages/app/cypress/e2e/specs_list_e2e.cy.ts +++ b/packages/app/cypress/e2e/specs_list_e2e.cy.ts @@ -127,6 +127,26 @@ describe('App: Spec List (E2E)', () => { cy.findByTestId('runnable-header').should('be.visible') }) + it('updates the spec filename when a new spec is selected', () => { + // load the first spec + cy.findAllByTestId('spec-item-link').contains('accounts_list.spec.js').click() + + // ensure the tests are loaded + cy.contains('[aria-controls=reporter-inline-specs-list]', 'Specs') + cy.findByText('Your tests are loading...').should('not.be.visible') + + // open the inline spec list + cy.get('body').type('f') + + // verify the first spec filename + cy.findByTestId('runnable-header').contains('accounts_list.spec.js') + + // select the second spec from the inline spec list + cy.findAllByTestId('spec-file-item').contains('accounts_new.spec.js').click() + // verify the spec filename was updated + cy.findByTestId('runnable-header').contains('accounts_new.spec.js') + }) + it('cannot open the Spec File Row link in a new tab with "cmd + click"', (done) => { let numTargets let newNumTargets diff --git a/packages/app/tsconfig.json b/packages/app/tsconfig.json index 347deb1bb0be..a96c821699ab 100644 --- a/packages/app/tsconfig.json +++ b/packages/app/tsconfig.json @@ -13,6 +13,7 @@ ], "compilerOptions": { "noImplicitThis": true, + "useDefineForClassFields": true, "paths": { "@cy/i18n": ["../frontend-shared/src/locales/i18n"], "@cy/components/*": ["../frontend-shared/src/components/*"], @@ -20,6 +21,7 @@ "@cy/store/*": ["../frontend-shared/src/store/*"], "@packages/*": ["../*"] }, + "allowJs": true, "types": [ "cypress", "cypress-real-events", diff --git a/packages/config/tsconfig.json b/packages/config/tsconfig.json index cf4b494620ff..2f41e195210a 100644 --- a/packages/config/tsconfig.json +++ b/packages/config/tsconfig.json @@ -10,9 +10,10 @@ "allowJs": false, "rootDir": "src", "noImplicitAny": true, + "noUncheckedIndexedAccess": true, "types": ["node"], "typeRoots": [ "../../node_modules/@types" ], } -} \ No newline at end of file +} diff --git a/packages/data-context/tsconfig.json b/packages/data-context/tsconfig.json index 587382a7499e..bfc314d22947 100644 --- a/packages/data-context/tsconfig.json +++ b/packages/data-context/tsconfig.json @@ -11,6 +11,7 @@ "lib": ["esnext"], "allowJs": false, "noImplicitAny": true, + "noUncheckedIndexedAccess": true, "types": ["cypress"], } -} \ No newline at end of file +} diff --git a/packages/driver/tsconfig.json b/packages/driver/tsconfig.json index 33203e370049..72cb39c9fc63 100644 --- a/packages/driver/tsconfig.json +++ b/packages/driver/tsconfig.json @@ -9,7 +9,6 @@ "preserveWatchOutput": true, "sourceMap": true, "strictNullChecks": true, - "forceConsistentCasingInFileNames": true, "noEmit": true, "outDir": "dist", "noErrorTruncation": true, diff --git a/packages/errors/tsconfig.json b/packages/errors/tsconfig.json index dfb951b17cde..3959f1d1fc2b 100644 --- a/packages/errors/tsconfig.json +++ b/packages/errors/tsconfig.json @@ -7,5 +7,6 @@ "allowJs": false, "noImplicitAny": true, "noImplicitReturns": false, + "noUncheckedIndexedAccess": true, } -} \ No newline at end of file +} diff --git a/packages/extension/tsconfig.json b/packages/extension/tsconfig.json index aa782866197b..a1b8190d11c3 100644 --- a/packages/extension/tsconfig.json +++ b/packages/extension/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../ts/tsconfig.json", "compilerOptions": { "target": "es2015", + "allowJs": true, "strict": false } } diff --git a/packages/graphql/src/utils/nexusTypegenUtils.ts b/packages/graphql/src/utils/nexusTypegenUtils.ts index f209bc45af2e..0480e9e65082 100644 --- a/packages/graphql/src/utils/nexusTypegenUtils.ts +++ b/packages/graphql/src/utils/nexusTypegenUtils.ts @@ -92,7 +92,7 @@ const nexusTypegenDebounced = (cfg: NexusTypegenCfg) => { debounced[cfg.filePath] = debounced[cfg.filePath] ?? _.debounce(nexusTypegen, 500) - debounced[cfg.filePath](cfg) + debounced[cfg.filePath]?.(cfg) } interface NexusTypegenWatchCfg extends NexusTypegenCfg { diff --git a/packages/graphql/tsconfig.json b/packages/graphql/tsconfig.json index d7e45065be2f..b5aef75f955c 100644 --- a/packages/graphql/tsconfig.json +++ b/packages/graphql/tsconfig.json @@ -12,6 +12,7 @@ "lib": ["esnext"], "allowJs": false, "noImplicitAny": true, + "noUncheckedIndexedAccess": true, "types": [] }, } diff --git a/packages/icons/tsconfig.json b/packages/icons/tsconfig.json index 8995f295a6c7..315454e205ac 100644 --- a/packages/icons/tsconfig.json +++ b/packages/icons/tsconfig.json @@ -3,6 +3,7 @@ "compilerOptions": { "allowJs": false, "noImplicitAny": true, + "noUncheckedIndexedAccess": true, "outDir": "dist", }, -} \ No newline at end of file +} diff --git a/packages/reporter/tsconfig.json b/packages/reporter/tsconfig.json index be6c7cd941b3..99b6a70b5bf3 100644 --- a/packages/reporter/tsconfig.json +++ b/packages/reporter/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../ts/tsconfig.json", "compilerOptions": { + "useDefineForClassFields": true, "types": [ "node", "cypress", diff --git a/packages/scaffold-config/tsconfig.json b/packages/scaffold-config/tsconfig.json index ae027f650086..dde12ed64ec4 100644 --- a/packages/scaffold-config/tsconfig.json +++ b/packages/scaffold-config/tsconfig.json @@ -12,6 +12,7 @@ "lib": ["esnext"], "allowJs": false, "noImplicitAny": true, + "noUncheckedIndexedAccess": true, "types": [] } -} \ No newline at end of file +} diff --git a/packages/telemetry/tsconfig.json b/packages/telemetry/tsconfig.json index d887c0486cc8..50c4b856c19c 100644 --- a/packages/telemetry/tsconfig.json +++ b/packages/telemetry/tsconfig.json @@ -6,6 +6,7 @@ "lib": ["esnext", "DOM"], "allowJs": false, "noImplicitAny": true, + "noUncheckedIndexedAccess": true, "types": ["cypress"], } } diff --git a/packages/ts/tsconfig.json b/packages/ts/tsconfig.json index 20f39e2b453c..7acbe3eff819 100644 --- a/packages/ts/tsconfig.json +++ b/packages/ts/tsconfig.json @@ -24,7 +24,7 @@ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - /* Modules */ + /* Modules */ "module": "commonjs", /* Specify what module code is generated. */ // "rootDir": "./", /* Specify the root folder within your source files. */ "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ @@ -98,8 +98,8 @@ "noUnusedLocals": false, /* Enable error reporting when local variables aren't read. */ "noUnusedParameters": false, /* Raise an error when a function parameter isn't read. */ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */