Open tja4472 opened 2 years ago
I can confirm the regression from 10.7 to 10.8. We made a change to extend the provided tsconfig
rather than the root which is why you are encountering issues. I would say the behavior is more correct after this change but there are still some issues to work out when it comes to how we are handling types/tsconfig, see my comment on a similar issue.
A workaround in the meantime would be to either add "src/index.d.ts"
to your tsconfig.app.json -> files
array or add a /// <reference types="../../src/index.d.ts" />
at the top of your component support file. Let me know how that works and we'll work on getting a handle on the types soon!
Adding "src/index.d.ts"
to the tsconfig.app.json -> files
array, worked. Thank you
Unfortunately in another project I use "exclude" which as you are ignoring
"include` doesn't apply.
https://www.typescriptlang.org/tsconfig#exclude
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
// ===
// https://github.com/cypress-io/cypress/issues/23940#issuecomment-1256390374
// "src/index.d.ts" --> "files"
// ===
"files": ["src/main.ts", "src/polyfills.ts", "src/index.d.ts"],
"exclude": [
"src/**/*.spec.ts",
"src/environments/**/*",
"src/app/+test-examples/**/*",
"src/app/firebase/firebase-config-dev.ts",
"src/app/firebase/firebase-config-emulator-demo.ts",
"src/app/firebase/firebase-config-prod.ts"
]
}
See https://github.com/tja4472/ngrx-task/blob/cypress-10-8-0/tsconfig.app.json
Current behavior
Chrome v105 Ubuntu 22.04.1 LTS
Executing task: npm run cypress:open:component
ERROR in src/app/app.module.ts:30:16 - error TS2339: Property 'Cypress' does not exist on type 'Window & typeof globalThis'.
30 if (window.Cypress) {
ERROR in src/app/services/app-actions-test.service.ts:11:16 - error TS2339: Property 'Cypress' does not exist on type 'Window & typeof globalThis'.
11 if (window.Cypress) {
2022-09-22 15:05:00: webpack compiled in 23098 ms (8da981c4306063db) GET /v1/pages/ChVDaHJvbWUvMTA1LjAuNTE5NS4xMjUSEAmZ_btOmwfnBhIFDRNQn9Q=?alt=proto 503 10761.766 ms - - POST /v1:GetModels?key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw 200 636.993 ms - - GET /v1/pages/ChVDaHJvbWUvMTA1LjAuNTE5NS4xMjUSEAmZ_btOmwfnBhIFDRNQn9Q=?alt=proto 200 544.080 ms - - GET /v4/threatListUpdates:fetch?$req=Ch4KDGdvb2dsZWNocm9tZRIOMTA1LjAuNTE5NS4xMjUaKQgHEAIaGwoNCAcQBhgBIgMwMDEwARCJ7QsaAhgHNGIDqSIEIAEgAigBGikIBRACGhsKDQgFEAYYASIDMDAxMAEQqs4OGgIYBzF2SbQiBCABIAIoARopCAEQAhobCg0IARAGGAEiAzAwMTABEOyOCxoCGAfJoVXfIgQgASACKAEaJwgKEAgaGQoNCAoQCBgBIgMwMDEwARAHGgIYB7rRKt8iBCABIAIoARooCAEQCBoaCg0IARAIGAEiAzAwMTAEEPYsGgIYB1_HIEQiBCABIAIoBBooCA8QAhoaCg0IDxAGGAEiAzAwMTABEPtyGgIYBzIcXLYiBCABIAIoARooCAgQAhoaCg0ICBAGGAEiAzAwMTABEOYQGgIYB0dDM0YiBCABIAIoARopCA0QAhobCg0IDRAGGAEiAzAwMTABEIDLARoCGAeC_luFIgQgASACKAEaJwgJEAIaGQoNCAkQBhgBIgMwMDEwARAgGgIYB372quUiBCABIAIoARopCAMQAhobCg0IAxAGGAEiAzAwMTABEI79ChoCGAdSSS7_IgQgASACKAEaKQgOEAIaGwoNCA4QBhgBIgMwMDEwARCd0gYaAhgHLhlAFCIEIAEgAigBGicIARACGhkKDQgBEAYYASIDMDAxMAMQFBoCGAdqu6BYIgQgASACKAMaKAgQEAIaGgoNCBAQBhgBIgMwMDEwARCwFBoCGAfFPmX2IgQgASACKAEiAggB&$ct=application/x-protobuf&key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw 200 653.414 ms - -
should work as with 10.7.0
Test code to reproduce
https://github.com/tja4472/ng-jest-cypress-template/tree/cypress-10-8-0
Cypress Version
10.8.0
Node version
v16.15.0
Operating System
Ubuntu 22.04.1 LTS
Debug Logs
No response
Other
No response